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.1.0.tar.gz
.
File metadata
- Download URL: git-syncer-0.1.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 487907680420c6c4622495aeb6155298c58b1dbb7797605a02639e563f399600 |
|
MD5 | 1586d29b3d7840c8d8919e4249ddb7ae |
|
BLAKE2b-256 | 9cfb0b6a9e2017c8145d08a0d373bff9af4c09551ffbfc77e46b9b850d6ea80c |
File details
Details for the file git_syncer-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: git_syncer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f40973c82b915db4114abebb7f0743e61199be2fb5da44b882b6a4d765b133 |
|
MD5 | c4afdcbafb40b0e9334b4683721472e2 |
|
BLAKE2b-256 | b6c291a92404a5c4f1b9ecc04d38e5bc03377e107d62802027a535e03ac59ee7 |