Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/costajob/rsync_cron
Install specified rsync command into crontab schedule
https://github.com/costajob/rsync_cron
rsync ruby schedule
Last synced: 13 days ago
JSON representation
Install specified rsync command into crontab schedule
- Host: GitHub
- URL: https://github.com/costajob/rsync_cron
- Owner: costajob
- Created: 2017-09-25T09:50:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T13:22:48.000Z (about 7 years ago)
- Last Synced: 2024-08-08T21:50:32.715Z (3 months ago)
- Topics: rsync, ruby, schedule
- Language: Ruby
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Table of Contents
* [Scope](#scope)
* [Installation](#installation)
* [Warning](#warning)
* [Usage](#usage)# Scope
The scope of this gem is to install the specified `rsync` command into the `crontab` schedule.# Installation
Install the gem from your shell:
```shell
gem install rsync_cron
```# Warning
Be aware that this library will write to the `crontab` file in a destructive way.
Do remember to take a backup before installing a new `crontab`.# Usage
The gem comes with a CLI interface, you can print its help by:
```shell
rsync_cron -h
Usage: rsync_cron --cron='15,30 21' --src=/ --dest=/tmp --log=/var/log/rsync.log --opts=noatime,temp-dir='./temp'
-c, --cron=CRON The cron string, i.e.: '15 21 * * *'
-s, --src=SRC The rsync source, i.e. [email protected]:files
-d, --dest=DEST The rsync dest, i.e. [email protected]:home/
-l, --log=LOG Log command output to specified file
-o, --opts=OPTS Merge specified extra options, when supported
-p, --print Print crontab command without installing it
-k, --check Check src and dest before installing crontab
-h, --help Prints this help
```## Default schedule
The `crontab` is scheduled one per day by default (at midnight).
You can specify a different schedule directly on the command line:
```shell
# run every sunday
rsync_cron --cron='* * * * 0' [email protected]:files --dest=~/tmp
```