Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the simplest way to unidirectional incremental syncing of a folder present on a Linux system.

+1 for using the command line. +2 for not using rsync (Seems to have some problems on my system.)

share|improve this question
3  
What exactly are your problems with rsync? –  innaM Jul 17 '09 at 9:51
3  
Since rsync very likely is the simplest answer, explain what problems you're having with that. (The problems may spill over to any other solution, anyhow.) –  Telemachus Jul 17 '09 at 10:37
add comment

3 Answers

up vote 4 down vote accepted

csync is a file synchronizer especially designed for you, the normal user.

csync is a library and ships commandline client by default. It is server-less and allows synchronisation through either sftp or samba.

Usage examples:

csync /home/csync smb://csync:secret@rupert.galaxy.site/Users/csync
csync /home/csync sftp://csync@krikkit.galaxy.site:2222/home/csync
share|improve this answer
add comment

I think you should solve your problems with rsync, that is the tried and true" syncronization tool for unixes.

rsync -uav --delete /loal/path example.com:/remote/path

Note: For bidirectional sync, you can use unison as well as csync.

share|improve this answer
add comment

This is how I would do a unidirectional sync with bare tools.

At the onset, tar the entire set of files and copy them to the destination point.
Also, setup a marker in the base directory.

touch /Source/base/directory/last-sync-time.txt

Now, we want to keep sync'ing from Source to Destination.

At the next time slot for syncing forward (from Source to Destination),

# The backup script
cd /Source/base/directory
tar cfj -N ./last-sync-time.txt backup.tar.bz2 .
scp backup.tar.bz2 user@backup-server:/Backup/Directory/
touch /Source/base/directory/last-sync-time.txt
rm -f backup.tar.bz2
  1. The -N ./filename tells tar to archive only files modified or created after filename was modified/created.
  2. Using a local reference for time confirms you make no mistake; if a backup was not taken for some reason, the next one will accumulate it
  3. You can setup this script as a cronjob entry on the Source machine
  4. I am assuming you will use scp with public key authentication
  5. Also assuming you can reach the backup-server whenever this script is issued.
  6. To be safer, you can add checks for confirming backup was stored and then, issue the touch command
  7. You can choose to also insert commands to expand the backups overlaying them over previous ones at the Destination point; Or, keep incremental tar.bz2 archives.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.