Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 2.2 KB

README.md

File metadata and controls

56 lines (36 loc) · 2.2 KB

docker-periodic-rsync

docker-periodic-rsync is a Docker image based on Debian 8 with cron, ssh and rsync for one-time or periodic remote rsync copy jobs.

Open source project:

Usage

Requirements:

  • setup passwordless SSH login on remote machines (setup)
  • /root/.ssh: mount your passwordless SSH public and private keys (id_rsa/id_rsa.pub, chown to user root)
  • /data: mount preferred target directory
  • /etc/crontab: mount your crontab file (for periodic usage)

For one-time usage (need specify command):

$ docker run -it --rm -v /srv/backup/.ssh:/root/.ssh -v /srv/backup/data:/data gw000/periodic-rsync rsync -zave ssh [email protected]:dir/ /data

For periodic usage (prepare crontab file /srv/backup/cron.d/backup):

# /etc/cron.d/backup: system-wide crontab
SHELL=/bin/sh

# m h dom mon dow user  command
*/5 *   *   *   * root  rsync -zave ssh [email protected]:dir/ /data
$ docker run -d -v /srv/backup/.ssh:/root/.ssh -v /srv/backup/cron.d:/etc/cron.d -v /srv/backup/data:/data --name backup gw000/periodic-rsync

Feedback

If you encounter any bugs or have feature requests, please file them in the issue tracker or even develop it yourself and submit a pull request over GitHub.

License

Copyright © 2016 gw0 [http://gw.tnode.com/] <[email protected]>

This library is licensed under the GNU Affero General Public License 3.0+ (AGPL-3.0+). Note that it is mandatory to make all modifications and complete source code of this library publicly available to any user.