Skip to main content

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:

  1. Create a private GitHub repository and clone it.
  2. Create a requirements.txt file, and add the git-syncer dependency.
  3. Create a main.py file:
from git_syncer import run
from git_syncer.jobs import add_cron_jobs, add_boot_jobs
from git_syncer.sync 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()
  1. Add a .gitignore file (tip: use gitignore.io). It must contain out/.
  2. Commit and push your changes.

On your remote machine (SSH to it):

  1. Set up GitHub credentials to clone your new repository.
    Highly recommended: instead of providing your own personal GitHub credentials, add an SSH deploy key to your repository. If you choose to do so, check the Allow write access checkbox.
  2. Clone your new repository to the remote machine.
  3. Set up virtual environment for this project and activate it (using source <venv_dir>/bin/activate).
  4. Install dependencies using pip install -r requirements.txt (git-syncer should be installed).
  5. ⚠️ THIS STEP WILL OVERRIDE YOUR EXISTING CRONTAB SETTINGS! ⚠️
    Activate the syncer using init-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-syncer-0.0.18.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

git_syncer-0.0.18-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file git-syncer-0.0.18.tar.gz.

File metadata

  • Download URL: git-syncer-0.0.18.tar.gz
  • Upload date:
  • Size: 9.3 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

Hashes for git-syncer-0.0.18.tar.gz
Algorithm Hash digest
SHA256 d587fa64a67a5db2d5ccdbe2155b7578c0d377d381cec52ea04e3e76038f0720
MD5 822bc21169819d0d6e24206baec5f519
BLAKE2b-256 90cfb085037185c34f1d3a0ad038c24ad3cdfd3263be6e78594427ecabcee571

See more details on using hashes here.

File details

Details for the file git_syncer-0.0.18-py3-none-any.whl.

File metadata

  • Download URL: git_syncer-0.0.18-py3-none-any.whl
  • Upload date:
  • Size: 11.4 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

Hashes for git_syncer-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 0ad425ca7856dbb0089c5a19564fd4e94f6f838663bd725135262925ebd7bfa1
MD5 d1c4995242b7b0c68a21ddc4dfe623a0
BLAKE2b-256 7aa5c8f6f2c1d99e823a6b432eb31ea40e6f9d82757f92829f40c0d5dcbf5fbd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page