Hi, What we want to do is synchronize our music files between our 2 servers like every 30 minutes or so. Been trying to find scripts to do this, but no success. The files are created on our Mac G4 running OS X server, and then tranferred manually to the IBM server in the same office on the same network. We would like to automate the process, by checking the G4 about every 30 minutes for changed files and then uploading them to the IBM, using the same directory structure, if possible.. It should also update any existing files on the IBM. Are we looking at the correct type of program in rsync? Or any suggestions? -- Bruce Therrien <bruce.therrien@wm-mw.org> This is the end of the internet. Please turn around and go back.
On 2005-03-29 23:50:33 -0500, Bruce Therrien wrote:> Are we looking at the correct type of program in rsync?Yes.> Or any suggestions?NFS. :-) Best regards Martin -- http://www.tm.oneiros.de
Bruce Therrien wrote:> Hi, > > What we want to do is synchronize our music files > between our 2 servers like every 30 minutes or so. > > Been trying to find scripts to do this, but no success. > > The files are created on our Mac G4 running OS X > server, and then tranferred manually to the IBM server > in the same office on the same network.So long as the synchronisation is one-way and you're not trying to merge changes made on the IBM to the G4 at the same time, then rsync is absolutely ideal for your needs.> We would like to automate the process, by checking the G4 > about every 30 minutes for changed files and then > uploading them to the IBM, using the same > directory structure, if possible..> > It should also update any existing files on the IBM. > Rsync does all of the checking for you and will only upload the new files or the changed parts of the existing ones, thereby minimising network traffic. You just give it a local source directory and a remote destination and it will do the rest. It's probably the quickest way you can do what you've specified. Terry.
This should solve your back up needs. rsync -avrW --delete G4-SOURCE IBM-DESTINATION
> From what I understand, doesn't the -a option > mean to archive?Yes, in the sence that file permissions are transfered aswell, so the destination files are exact the same as the source files. It doesn't mean that the files are being zip, rar, gzip packed or anything like that.> We don't want to archive the files, just make > the directory on the IBM exactly the same > as the one on the G4.Then you should use the -a option.> The files are created on the G4, but actually downloaded from > the IBM, but my developer doesn't always remember > to keep uploading to the IBM, hence my thoughts about syncing.So you want to check the timestamp on the files on both the G4 and IBM, and overwrite the oldest?
> Yes, > We would want to overwrite the older file > on the IBM server, to match the updated version > on the G4.This is possible, but I haven't tried that.> I guess I mis-understood the -a option.... > :)Sort of=)> Does rsync need to be installed on both servers to work?I don't know what is the best way, when you want to send data both ways. Try reading: http://rsync.samba.org/ftp/rsync/preview/rsync.html http://rsync.samba.org/ftp/rsync/preview/rsyncd.conf.html and look under CONNECTING TO AN RSYNC SERVER. There are also good examples at http://samba.anu.edu.au/rsync/examples.html You mentioned you wanted to back up every 30minutes. Be sure that all data can in worst case be transferred in less than 15 minutes to avoid an never ending queue. I would advise to only back up once per day for many reasons, but most importantly, if you by mistake delete a file, you have to notice it within 30 minutes before the file is deleted on the back up aswell. Doing back up while someone is editing a file is never good, so try to only make the back up, when the chance of someone working on the files is low. Daily Cron would be perfect for this job.
> I'll check out all the options and do some > testing, and let you know my results.If you use the --dry-run, rsync will act exactly like a back up is being done, but no data is transfered or altered in anyway. So you can try all sorts of crazy things without risking data =) Try also the --log-format='%i %l %f' which will inform you what will happen to the files, and what have changed (size, checksum, timestamp, permissions, etc...). This requires rsync 2.6.4 See the new manpage for syntax.
> Do I have to tell rsync what the username and > password is for the remote IBM?Yes, one way or the other. Append -e "ssh -l root" or if you have an identity key, so you won't have to type password (this is copy/paste from a previous bug repport) -e "ssh -i /root/.ssh/rsync/id_dsa -l root" Are you running a rsync server on the IBM? In case you aren't you can try this (again copy/paste) rsync --server --daemon --config=/root/rsync/conf . /root/rsync/conf contains: =========================log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid use chroot = no [rootfs] path = / max connections = 1 list = no uid = root include from = /root/rsync/include exclude from = /root/rsync/exclude hosts allow = <IP>,127.0.0.1 transfer logging = yes refuse options = delete* ========================= Remove the double dashed lines (the equal signs) and replace IP with the client (your case G4) IP.