Allows cron job control and command execution on a remote machine using git infrastructure
Project description
Git syncer
Allows cron job control and command execution on a remote machine using git infrastructure.
👷🏻 Please note, this project is still a work-in-progress 🏗️
Quick start
On your computer, set up the basic repository:
- Create a private GitHub repository and clone it.
- Create a
requirements.txt
file, and add thegit-syncer
dependency. - Create a
main.py
file:
from git_syncer import run
from git_syncer.jobs import add_cron_jobs, add_boot_jobs
from git_syncer.executor import add_commands
add_boot_jobs() # Add boot jobs here ⛷️
add_cron_jobs() # Add cron jobs here 🚵🏻♀️
add_commands() # Add remote commands here 🏋🏻♂️
if __name__ == "__main__":
run()
- Add a
.gitignore
file (tip: use gitignore.io). It must containout/
. - Commit and push your changes.
On your remote machine (SSH to it):
- Set up GitHub credentials to clone your new repository.
Highly recommended: instead of providing your own personal GitHub credentials on the remote machine, add an SSH deploy key to your repository. If you choose to do so, check theAllow write access
checkbox. - Clone your new repository to the remote machine.
- Set up virtual environment for this project and activate it (using
source <venv_dir>/bin/activate
). cd
to your repository directory.- Install dependencies using
pip install -r requirements.txt
(git-syncer
should be installed). - ⚠️ THIS STEP WILL OVERRIDE YOUR EXISTING CRONTAB SETTINGS! ⚠️
Activate the syncer using the CLI commandinit-syncer
.
From now on, you can add new cron jobs and run remote commands on the machine using this git repository. For more details, see the usage section.
Usage
This tool writes logs to ~/logs/git-syncer/
.
Remote commands
👷🏻 TODO
Boot jobs
👷🏻 TODO
Cron jobs
👷🏻 TODO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file git-syncer-0.2.1.tar.gz
.
File metadata
- Download URL: git-syncer-0.2.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.2.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c10399526b28d7d8c95b272a671dcca7c01a61d8a3b20bc506655c537b7db602 |
|
MD5 | 5206e6efc52184b0a2dc6490a52b6665 |
|
BLAKE2b-256 | d55d3cdfab755a53e6d12f9db22dc96eb47d6c36e6928973cdfb596795d71f71 |
File details
Details for the file git_syncer-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: git_syncer-0.2.1-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.2.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c46da4e3499e2e2fa74018718b554321d7730e9a4ceaa4c5ce9b92f996a6225b |
|
MD5 | 917699fa83b2e8f0f542d17e3ebca8c6 |
|
BLAKE2b-256 | 3193255303481e59fb5fbfc9867e743e1c202d166fc8207b61408bda62f7d737 |