Code Monkey home page Code Monkey logo

rsync_cron's Introduction

Table of Contents

Scope

The scope of this gem is to install the specified rsync command into the crontab schedule.

Installation

Install the gem from your 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:

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:

# run every sunday
rsync_cron --cron='* * * * 0' [email protected]:files --dest=~/tmp

rsync_cron's People

Contributors

costajob avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.