#!/bin/bash ###### Osync - Rsync based two way sync engine with fault tolerance ###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr) #### Config file rev 2207201302 ## Sync job identification, any string you want, no spaces SYNC_ID="sync_test" ## Directories to synchronize MASTER_SYNC_DIR="/home/git/osync/test/the separate dir1" SLAVE_SYNC_DIR="/home/git/osync/test/the separate dir2" ## Create sync directories if they do not exist CREATE_DIRS=yes ## List of directories to exclude in sync on both sides (rsync patterns, wildcards work). Must be relative paths. List is separated by PATH SEPARATOR CHAR defined below (semicolon by default). RSYNC_EXCLUDE_PATTERN="tmp;archives" ## You might change this separator case in the unholy case that your filename may contain semicolons. Change it then to whatever unholy char you want. PATH_SEPARATOR_CHAR=";" ## Generate an alert if master or slave have lass space than given value in KB. MINIMUM_SPACE=10240 ## If enabled, synchronization will be processed with sudo command. See documentation SUDO_EXEC=no ## Paranoia option. Don't change this unless you read the documentation and know what you are doing. RSYNC_EXECUTABLE=rsync ##Remote options (will sync slave through ssh tunnel, needs RSA key. See documentation for remote sync. REMOTE_SYNC=no SSH_RSA_PRIVATE_KEY=~/.ssh/id_rsa REMOTE_USER=backupuser REMOTE_HOST=your-remote-host.tld REMOTE_PORT=22 ## ssh compression should be used unless your remote connection is good enough (LAN) SSH_COMPRESSION=yes ## Check for connectivity to remote host before launching remote backup tasks. Be sure the hosts responds to ping. Failing to ping will skip current task. REMOTE_HOST_PING=no ## Check for internet access by pinging one or more 3rd party hosts before remote backup tasks. Leave empty if you don't want this check to be be performed. Failing to ping will skip current task. REMOTE_3RD_PARTY_HOST="www.kernel.org www.google.fr" ## Preserve ACLS. Make sure target FS can hold ACLs or you'll get loads of errors. PRESERVE_ACL=no ## Preserve Xattr PRESERVE_XATTR=no ## Let RSYNC compress file transfers. Do not use if you already enabled SSH compression. RSYNC_COMPRESS=yes ## Maximum execution time (in seconds) for sync process. Soft exec time only generates warning. Hard exec time will generate warning and stop sync process. SOFT_MAX_EXEC_TIME=18000 HARD_MAX_EXEC_TIME=43200 ## If the same file exists on both sides, newer version will be used. If both files have the same timestamp but differ, CONFILCT_PREVALANCE sets winner CONFLICT_PREVALANCE=master ## Keep a backup of a file if gets updated from remote side CONFLICT_BACKUP=yes ## Keep multiple backups of a file if it gets updated from remote side. This can be very space consuming CONFLICT_BACKUP_MULTIPLE=no ## Number of days to keep backups CONFLICT_BACKUP_DAYS=30 ## On deletition propagation to sync partner, keep a backup of deleted files on sync partner SOFT_DELETE=yes ## Number of days to keep deleted files SOFT_DELETE_DAYS=30 ## Try to resume an aborted sync task RESUME_SYNC=yes ## Number maximum resume tries before initating a new sync RESUME_TRY=2 ## When a pidlock exists on slave that does not correspond to master's sync-id, force pidlock removal. Be carefull with this option if you have multiple masters. FORCE_STRANGER_LOCK_RESUME=no ## List of alert mails separated by spaces DESTINATION_MAILS="your@alert.tld" ## Run local commands before and after sync task LOCAL_RUN_BEFORE_CMD="" LOCAL_RUN_AFTER_CMD="" ## Run commands on remote slave befre and after sync task REMOTE_RUN_BEFORE_CMD="" REMOTE_RUN_AFTER_CMD="" ## Maximum execution time (in seconds) for commands before sync task. Commands get killed if not finished after MAX_EXC_TIME. Set this to 0 to disable killing. MAX_EXEC_TIME_PER_CMD_BEFORE=0 ## Maximum execution time (in seconds) for commands after sync task. Commands get killed if not finished after MAX_EXEC_TIME. Set this to 0 to disable killing command. MAX_EXEC_TIME_PER_CMD_AFTER=0