2
0
mirror of https://github.com/deajan/osync synced 2024-11-05 12:01:02 +00:00
osync/sync.conf

127 lines
5.5 KiB
Plaintext
Raw Normal View History

2013-07-15 22:10:23 +00:00
#!/bin/bash
###### Osync - Rsync based two way sync engine with fault tolerance
2013-07-16 11:55:15 +00:00
###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr)
2013-11-02 20:57:15 +00:00
#### Config file rev 0211201302
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## ---------- GENERAL OPTIONS
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## Sync job identification
SYNC_ID="sync_test"
2013-08-18 11:15:40 +00:00
2013-11-02 20:57:15 +00:00
## Directories to synchronize. Master must be on the system Osync runs on. Slave can be either on the same system, or on a remote one.
MASTER_SYNC_DIR="/home/git/osync/test/dir1"
SLAVE_SYNC_DIR="/home/git/osync/test/dir2"
2013-07-15 22:10:23 +00:00
## Create sync directories if they do not exist
CREATE_DIRS=no
2013-07-21 19:40:55 +00:00
2013-11-02 20:57:15 +00:00
## Log file location. Leaving this empty will create a logfile at /var/log/osync_version_SYNC_ID.log (or current directory if /var/log doesn't exist)
LOGFILE=""
## List of directories to exclude from sync on both sides (rsync patterns, wildcards work).
## Paths are relative to sync dirs. List elements are separated by a semicolon.
2013-07-24 19:03:58 +00:00
RSYNC_EXCLUDE_PATTERN="tmp;archives"
2013-11-02 20:57:15 +00:00
## List elements separator char. You may set an alternative seperator char for your directories lists above.
2013-07-19 16:15:25 +00:00
PATH_SEPARATOR_CHAR=";"
2013-11-02 20:57:15 +00:00
## Generate an alert if master or slave replicas have less free space than given value in KB.
2013-07-22 19:14:57 +00:00
MINIMUM_SPACE=10240
2013-07-15 22:10:23 +00:00
## Bandwidth limit Kbytes / second. Leave 0 to disable limitation
BANDWIDTH=0
2013-11-02 20:57:15 +00:00
## If enabled, synchronization will be processed as superuser. See documentation for /etc/sudoers file configuration.
2013-07-24 19:03:58 +00:00
SUDO_EXEC=no
2013-11-02 20:57:15 +00:00
## Paranoia option. Don't change this unless you read the documentation.
2013-07-15 22:10:23 +00:00
RSYNC_EXECUTABLE=rsync
2013-11-02 20:57:15 +00:00
## ---------- REMOTE SYNC OPTIONS
## The following options allow Osync to sync a slave replica on a remote system via an SSH tunnel.
## Needs public RSA key need to be put into ~/.ssh/authorized_keys in remote users home directory. See documentation for remote sync.
2013-07-15 22:10:23 +00:00
REMOTE_SYNC=no
SSH_RSA_PRIVATE_KEY=~/.ssh/id_rsa
2013-08-24 17:51:39 +00:00
REMOTE_USER=syncuser
2013-07-24 19:03:58 +00:00
REMOTE_HOST=your-remote-host.tld
REMOTE_PORT=22
## ssh compression should be used unless your remote connection is good enough (LAN)
2013-07-15 22:10:23 +00:00
SSH_COMPRESSION=yes
2013-11-02 20:57:15 +00:00
2013-08-24 17:51:39 +00:00
## Check for connectivity to remote host before launching remote sync task. Be sure the hosts responds to ping. Failing to ping will stop sync.
REMOTE_HOST_PING=no
2013-11-02 20:57:15 +00:00
2013-08-24 17:51:39 +00:00
## Check for internet access by pinging one or more 3rd party hosts before remote sync task. Leave empty if you don't want this check to be be performed. Failing to ping will stop sync.
## If you use this function, you should set more than one 3rd party host, and be sure you can ping them.
## Be aware some DNS like opendns redirect false hostnames. Also, this adds an extra execution time of a bit less than a minute.
REMOTE_3RD_PARTY_HOSTS="www.kernel.org www.google.fr"
2013-11-02 20:57:15 +00:00
2013-10-10 18:28:40 +00:00
## Remote rsync executable path. Leave this empty in most cases
REMOTE_RSYNC_PATH=""
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## ---------- MISC OPTIONS
## Preserve ACLS. Make sure source and target FS can manage same ACLs or you'll get loads of errors.
2013-07-24 19:03:58 +00:00
PRESERVE_ACL=no
2013-11-02 20:57:15 +00:00
## Preserve Xattr. Make sure source and target FS can manage same Xattrs or you'll get loads of errors.
2013-07-24 19:03:58 +00:00
PRESERVE_XATTR=no
2013-11-02 20:57:15 +00:00
## Let RSYNC compress file transfers. Do not use this if both master and slave replicas are on local system. Also, do not use this if you already enabled SSH compression.
2013-07-15 22:10:23 +00:00
RSYNC_COMPRESS=yes
2013-11-02 20:57:15 +00:00
## Maximum execution time (in seconds) for sync process. Soft exec time only generates a warning. Hard exec time will generate a warning and stop sync process.
SOFT_MAX_EXEC_TIME=7200
HARD_MAX_EXEC_TIME=10600
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## ---------- BACKUP AND TRASH OPTIONS
## Enabling this option will keep a backup of a file on the target replica if it gets updated from the source replica. Backups will be made to .osync_workdir/backups
2013-07-16 11:55:15 +00:00
CONFLICT_BACKUP=yes
2013-11-02 20:57:15 +00:00
## Keep multiple backup versions of the same file. Warning, This can be very space consuming.
2013-07-24 19:03:58 +00:00
CONFLICT_BACKUP_MULTIPLE=no
2013-11-02 20:57:15 +00:00
## Osync will clean backup files after a given number of days. Setting this to 0 will disable cleaning and keep backups forever. Warning: This can be very space consuming.
CONFLICT_BACKUP_DAYS=30
2013-11-02 20:57:15 +00:00
## If the same file exists on both replicas, newer version will be synced. However, if both files have the same timestamp but differ, CONFILCT_PREVALANCE sets winner replica.
CONFLICT_PREVALANCE=master
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## On deletition propagation to the target replica, a backup of the deleted files can be kept. Deletions will be kept in .osync_workdir/deleted
2013-07-15 22:10:23 +00:00
SOFT_DELETE=yes
2013-11-02 20:57:15 +00:00
## Osync will clean deleted files after a given number of days. Setting this to 0 will disable cleaning and keep deleted files forever. Warning: This can be very space consuming.
2013-07-15 22:10:23 +00:00
SOFT_DELETE_DAYS=30
2013-11-02 20:57:15 +00:00
## ---------- RESUME OPTIONS
2013-07-24 19:03:58 +00:00
## Try to resume an aborted sync task
RESUME_SYNC=yes
2013-11-02 20:57:15 +00:00
## Number maximum resume tries before initating a fresh sync.
RESUME_TRY=2
2013-11-02 20:57:15 +00:00
## When a pidlock exists on slave replica 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
2013-11-02 20:57:15 +00:00
## ---------- ALERT OPTIONS
## List of alert mails separated by spaces
2013-07-24 19:03:58 +00:00
DESTINATION_MAILS="your@alert.tld"
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## Windows (MSYS environment) only mail options (used by sendemail.exe)
SENDER_MAIL="alert@your.system"
SMTP_SERVER=smtp.your.isp.com
SMTP_USER=
SMTP_PASSWORD=
2013-11-02 20:57:15 +00:00
## ---------- EXECUTION HOOKS
## Commands can will be run before and / or after sync process (remote execution will only happen if REMOTE_SYNC is set).
2013-07-15 22:10:23 +00:00
LOCAL_RUN_BEFORE_CMD=""
LOCAL_RUN_AFTER_CMD=""
2013-07-24 19:03:58 +00:00
REMOTE_RUN_BEFORE_CMD=""
REMOTE_RUN_AFTER_CMD=""
2013-07-15 22:10:23 +00:00
2013-11-02 20:57:15 +00:00
## Max execution time of commands before they get force killed. Leave 0 if you don't wan't this to happen. Time is specified in seconds.
2013-07-15 22:10:23 +00:00
MAX_EXEC_TIME_PER_CMD_BEFORE=0
MAX_EXEC_TIME_PER_CMD_AFTER=0
2013-09-11 14:22:49 +00:00
2013-11-02 20:57:15 +00:00
## Stops Osync execution if one of the above commands fail
2013-09-11 14:22:49 +00:00
STOP_ON_CMD_ERROR=yes