mirror of
https://github.com/deajan/osync
synced 2024-11-05 12:01:02 +00:00
80 lines
3.8 KiB
Bash
80 lines
3.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
###### osync - Rsync based two way sync engine with fault tolerance
|
|
###### (C) 2013-2017 by Orsiris de Jong (www.netpower.fr)
|
|
###### osync-target-helper v1.2.2+ config file rev 2017061901
|
|
|
|
## ---------- GENERAL OPTIONS
|
|
|
|
## Sync job identification
|
|
INSTANCE_ID="sync_test"
|
|
|
|
## Directories to synchronize.
|
|
## Initiator is the system main osync runs on. The initiator directory must be a remote path for osync target helper to contact.
|
|
INITIATOR_SYNC_DIR="ssh://backupuser@yourhost.old:22//home/git/osync/dir1"
|
|
|
|
## Target is the system osync synchronizes to. The target directory must be a local.
|
|
TARGET_SYNC_DIR="/home/git/osync/dir2"
|
|
|
|
## If the target system is remote, you can specify a RSA key (please use full path). If not defined, the default ~/.ssh/id_rsa will be used. See documentation for further information.
|
|
SSH_RSA_PRIVATE_KEY="/home/backupuser/.ssh/id_rsa"
|
|
|
|
## Alternatively, you may specify an SSH password file (less secure). Needs sshpass utility installed.
|
|
SSH_PASSWORD_FILE=""
|
|
|
|
## When using ssh filter, you must specify a remote token matching the one setup in authorized_keys
|
|
_REMOTE_TOKEN=SomeAlphaNumericToken9
|
|
|
|
## 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=""
|
|
|
|
## If enabled, synchronization on remote system will be processed as superuser. See documentation for /etc/sudoers file configuration.
|
|
SUDO_EXEC=no
|
|
|
|
## ---------- REMOTE SYNC OPTIONS
|
|
|
|
## ssh compression should be used unless your remote connection is good enough (LAN)
|
|
SSH_COMPRESSION=yes
|
|
|
|
## Ignore ssh known hosts. DANGER WILL ROBINSON DANGER ! This can lead to security issues. Only enable this if you know what you're doing.
|
|
SSH_IGNORE_KNOWN_HOSTS=no
|
|
|
|
## 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
|
|
|
|
## 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.com"
|
|
|
|
## Minimum time (in seconds) in file monitor /daemon mode between modification detection and sync task in order to let copy operations finish.
|
|
MIN_WAIT=60
|
|
|
|
## Maximum time (in seconds) waiting in file monitor / daemon mode. After this time, sync is run.
|
|
## Use 0 to wait indefinitely.
|
|
MAX_WAIT=7200
|
|
|
|
## ---------- ALERT OPTIONS
|
|
|
|
## List of alert mails separated by spaces
|
|
## Most Unix systems (including Win10 bash) have mail support out of the box
|
|
## Just make sure that the current user has enough privileges to use mail / mutt / sendmail and that the mail system is configured to allow outgoing mails
|
|
## on pfSense platform, smtp support needs to be configured in System > Advanced > Notifications
|
|
DESTINATION_MAILS="your@alert.tld"
|
|
|
|
## Optional change of mail body encoding (using iconv)
|
|
## By default, all mails are sent in UTF-8 format without header (because of maximum compatibility of all platforms)
|
|
## You may specify an optional encoding here (like "ISO-8859-1" or whatever iconv can handle)
|
|
MAIL_BODY_CHARSET=""
|
|
|
|
## Additional mail parameters needed for Android / Busybox / Cygwin / MSYS
|
|
## Android & Busybox use sendmail (and openssl if encryption is needed)
|
|
## MSYS & Cygwin Windows mail support relies on mailsend.exe from muquit, http://github.com/muquit/mailsend which needs to be in %PATH% environment variable
|
|
SENDER_MAIL="alert@your.system.tld"
|
|
SMTP_SERVER=smtp.your.isp.tld
|
|
SMTP_PORT=25
|
|
# encryption can be tls, ssl or none
|
|
SMTP_ENCRYPTION=none
|
|
SMTP_USER=
|
|
SMTP_PASSWORD=
|