|1||Preview - only show what wil be done (dry run, no updates)|
|2||Synchronize - execute session|
|-1||Preview inverse - preview with source and destination reversed|
|-2||Synchronize inverse - synchronize with source and destination reversed|
|i||Session Info - show session info as configured in config file|
|q||Quit - exit menu (in this example you return to the main menu)|
Srsync exits with one of the following exit codes:
|0||No error or user quits from menu|
|1||Error reading configuration file|
|3||Error in configuration file|
|4||Rsync error (exit code 4 can only occur with the -x option)|
When the user quits from a menu, the exit code will always be 0.
Below a list of rsync option you might want to use:
-a, --archive archive mode equals -rtlpgoD (no -H,-A,-X) -r, --recursive recurse into directories -t, --times preserve modification times (only update changed files) -l, --links copy symlinks as symlinks -p, --perms preserve permissions -g, --group preserve group -o, --owner preserve owner (super-user only) -D same as --devices --specials --devices preserve device files (super-user only) --specials preserve special files --delete delete extraneous files from dest dirs -v, --verbose increase verbosity (more info) -h, --human-readable output numbers in a human-readable format --modify-window=NUM compare mod-times with reduced accuracy
Do not use the following options in the configuration file. These options are used in srsync already where appropriate.
-n, --dry-run perform a trial run with no changes made (preview) --progress show progress during transfer (synchronization)
If the destination and source directories are on ext file systems, you may use for example the following rsync options:
-a (same as: -rtlpgoD) -a --delete -avh --delete
On NTFS the options -l -p -g -o, -D (and therefore also -a) are not supported. If the destination or source directory is on NTFS, use -rt in stead of the option -a. For example:
-rt -rt --delete -rtvh --delete
USB sticks and media players often use the FAT file system. If you want to synchronize a FAT stick or player, you need to use a special rsync option.
On a FAT file system, just like NTFS, the -a option is not supported. Furthermore the time stamp on a FAT file system is inaccurate. This means that during synchronization, all files (unchanged files too) are updated, even with the -t option. To avoid this, use the special option --modify-window=1:
-rt --modify-window=1 -rt --delete --modify-window=1 -rtvh --delete --modify-window=1
Note: When syncing to my MP3 player, sometimes unchanged files are updated, even with the -t option and --modify-window=1. I discovered a time stamp mismatch (between the files on my computer and the files on my player) of exactly one hour or one hour and one second (something to do with summer and winter time?). To prevent unchanged files from being updated, I changed --modify-window=1 to --modify-window=3601.
Each time you synchronize to a remote computer, you will have to enter a user name and password for that remote computer. If you do not like that, you can automatize the remote login.
Say you run srsync as user andy on computer alfa and you want to synchronize to computer beta as user bernie. You will need an automatic login from computer alfa as user andy to computer beta as user bernie.
andy@alfa:~$ ssh-keygen -t rsaUse the default name id_rsa for the file in which to save the private key (just hit enter) and do not use a passphrase (hit enter twice).
andy@alfa:~$ ssh bernie@beta mkdir .sshYou will have to enter bernie@beta's password.
andy@alfa:~$ cat .ssh/id_rsa.pub | ssh bernie@beta 'cat >> .ssh/authorized_keys'You will have to enter bernie@beta's password again.
andy@alfa:~$ ssh bernie@beta
Srsync is free software. This means that everyone may use, copy and modify srsync and even distribute modified versions. Srsync is published under the GNU General Public License. This ensures that the script remains free.
I know srsync is just a simple script. So why the fuss to publish it under this "copyleft" license? For me it is just a way to show that I support free software. And I also wanted to see how difficult it would be to publish srsync under the GNU GPL. Now I know: it is easy!
More information about free software and the GNU General Public License can be found on the website of the Free Software Foundation.