Oefenweb.rsync_sync
rsync-sync
Perform synchronization using rsync.
Requirements
rsync(will be installed)
Variables
rsync_sync_install_path: [default:/usr/local/bin]: Install directoryrsync_sync_scripts: [default:{}]: Scripts declarationsrsync_sync_scripts.key: [required]: The name of the script (e.g.last-backup)rsync_sync_scripts.key.pre: [optional, default[]]: Pre sync commandsrsync_sync_scripts.key.rsync: [required]: Rsync declarationsrsync_sync_scripts.key.rsync.src: [required]: The source directoryrsync_sync_scripts.key.rsync.dest: [required]: The destination directoryrsync_sync_scripts.key.rsync.options: [optional, default[]]: Options (e.g.['--aP', '--delete'])rsync_sync_scripts.key.rsync.time: [optional, defaultfalse]: Whether or not to time thersynccommandrsync_sync_scripts.key.post: [optional, default[]]: Post sync commandsrsync_sync_x_from_files: [optional, default[]]:rsync_sync_x_from_files.{n}.path: [required]: The remote path of the file (relative to/etc/rsync-sync)rsync_sync_x_from_files.{n}.owner: [optional, defaultroot]: The name of the user that should own the filersync_sync_x_from_files.{n}.group: [optional, defaultroot]: The name of the group that should own the filersync_sync_x_from_files.{n}.mode: [optional, default0644]: The UNIX permission mode bits of the filersync_sync_x_from_files.{n}.content: [optional, default[]]: File content linesrsync_sync_jobs: [default:[]]: Sync jobs (scheduled bycron.d)rsync_sync_jobs.{n}.name: [required]: Description of a crontab entry, should be unique, and changing the value will result in a new cron task being created (e.g.last-backup)rsync_sync_jobs.{n}.job: [required]: The command to execute (e.g./usr/local/bin/last-backup)rsync_sync_jobs.{n}.state: [default:present]: Whether to ensure the job is present or absentrsync_sync_jobs.{n}.day: [default:*]: Day of the month the job should run (1-31,*,*/2)rsync_sync_jobs.{n}.hour: [default:*]: Hour when the job should run (e.g.0-23,*,*/2)rsync_sync_jobs.{n}.minute: [default:*]: Minute when the job should run (e.g.0-59,*,*/2)rsync_sync_jobs.{n}.month: [default:*]: Month of the year the job should run (e.g1-12,*,*/2)rsync_sync_jobs.{n}.weekday: [default:*]: Day of the week that the job should run (e.g.0-6for Sunday-Saturday,*)
Dependencies
None
Example(s)
Synchronization a remote backup and import it
---
- hosts: all
roles:
- oefenweb.rsync-sync
vars:
rsync_sync_scripts:
last-backup:
pre:
- 'ssh -q -t example.com "test ! -f /var/lock/mydumper-backup"'
rsync:
src: '-e ssh example.com:/data/backup/mydumper/'
dest: '/data/backup/mydumper'
options:
- '-aP'
- '--delete'
post:
- mydumper-restore
rsync_sync_x_from_files:
- path: last-backup-include
content:
- |
+ *_app.*videos-schema.sql
+ *_app.*videos.sql
+ *_app_archive.*.sql
+ *_app_archive.*-schema.sql
+ metadata
- *
rsync_sync_jobs:
- name: last-backup
job: /usr/local/bin/last-backup
minute: 0
License
MIT
Author Information
Mischa ter Smitten
Feedback, bug-reports, requests, ...
Are welcome!
ansible-galaxy install Oefenweb.rsync_sync