You are not logged in.

#1 2009-07-18 10:50:27

ermin
Member
Registered: 2009-02-21
Posts: 9

sync usb flash drive with a hdd folder

I would like to know if there is a way to synchronize my USB stick with a certain folder on my HDD. By synchronizing, I mean that I want files on the HDD to replace those files on the USB stick that are older. I guess it is possible with Cron, but since I am a not yet a pro with the shell commands, I need some help out there.

It would be also nice if the sync could start automatically as soon as the USB stick is mounted and/or every hour, and that all with a nice gui.  Is there such a programm?

Last edited by ermin (2009-07-18 10:52:16)

Offline

#2 2009-07-18 11:02:52

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: sync usb flash drive with a hdd folder

I doesn't sounds like exactly what you are looking for, but the best app I've found for syncing folders is unison. I think there is a command line mode (as well as the GUI I usually use), so maybe you could schedule it with cron.

Offline

#3 2009-07-18 11:34:33

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: sync usb flash drive with a hdd folder

May be worth looking at rsync, there is also a GUI called Grsync.

http://wiki.archlinux.org/index.php/Rsync


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#4 2009-07-18 15:22:56

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: sync usb flash drive with a hdd folder

Yeah with rsync, but rsync is not enough, you must call rsync in the related udev rule, if you would like to do it automatically after plug-in.
Hope this helps.

Offline

#5 2009-07-19 13:37:12

ermin
Member
Registered: 2009-02-21
Posts: 9

Re: sync usb flash drive with a hdd folder

I have decided to use rsync and cron:

*/30 *    * * * rsync -apvb --delete /source/folder /destination/folder > /home/user/usb_backup_log

This seems to work fine. I still have one concern: If the usb stick is taken out, without unmounting, it can lead to data loss.
Any rsync option for that? Or should i just periodically remount the usb stick with cron?

Offline

Board footer

Powered by FluxBB