Jump to content

Rsync command to update files inside directories


Recommended Posts

Posted

Hello,

 

I used to use RsyncX to update my Joomla installation. It worked fine. It is now well out of date and although it would do for what i need it for unfortunately i cannot find a link to download it now. So i thought i would give the command line a bash.

 

Now it doesn't seem as straight forward as i would have hoped to use Rsync at the command line. I would also be looking to upgrade to 3.0.x but i can do this bit OK i think, following a tut from Bombich.

 

My question is how would i be able to update the files for Joomla 1.5.9 to 1.5.10 using Rsync from the command line?

 

Does any one do it like this?

 

and how do you guys update your Joomla install

 

Thanks.

Posted

Anyone?

 

I think the commands are close the the unix variant and possibly Linux (although i wouldn't put money on it). Just thought someone might be able to give me a pointer in the right direction.

Posted

Hi

 

I am just starting to experiment with rsync, but I am wimping out and using Deltacopy, the nearest I can find to a Windows GUI.

 

As you set your options it appears to display the command line it's using - so while it's not the straightforward answer I am sure you were hoping for, it may give you a pointer.

Posted

Yeah, unfortunately there is no deltacopy for OS X :(

 

Maybe something else that is similar. Does anyone know if arSync can do what i need?

I've had a look but it doesn't do remote rsyncing. I would like to use this ability further on down the line. I do think that learning rsync could be the best method overall. Just not sure where to start. Just looking at the man pages at the moment to get to grips with what each bit means.

Posted

No but i will be soon. Just keep finding interesting threads to read.

 

Damn you edugeek. Will everyone stop posting so i can get some work done :)

 

Not really. Keep em coming. :D

 

Thanks for the command, CyberNerd. What does each stage of it do?

 

Do i have to put a slash on the end of the src dir so as to copy the contents only?

Posted
Thanks for the command. It worked a treat. Now to understand ssh public/private key pairing and how to utilise it on my server for rsync over ssh to duplicate my web-server.
  • 2 weeks later...
Posted (edited)

Hello Mark

 

Have just come across this thread. What you could try is:

 

rsync -avz /Volumes/Raid-Main /Volumes/Raid_Backup

 

This should recursively transfer all files from /Volumes/Raid-Main on the source node into the destination directory on the remote node. Files should be transferred in archive mode. Hopefully preserving symbolic links, attributes & permissions etc. during the transfer. You should even get a bit of compression thrown in.

 

You should be able to even log the transfers:

 

rsync -aEx /Volumes/Raid-Main /Volumes/Raid_Backup >/var/log/rsync.log 2> /var/log/rsync.err

 

or possibly:

 

rsync -avExz /Volumes/Raid-Main /Volumes/Raid_Backup >/var/log/rsync.log 2> /var/log/rsync.err

 

Rysnc uses ssh to make remote transfers. What that means is ssh should be installed at both ends. If both nodes are macs then it should be there in the default binaries. You're not limited to ssh either as you can use remsh or even rsh. Other alternatives are ditto and asr. Consult the manual pages for usage.

 

However the other contributor's suggestion would be more than adequate

 

Hope this helps?

 

Antonio Rocco (ACSA)

Edited by AntonioRocco
  • Thanks 1
Posted

Thanks Tony.

 

Do i need to start SSH first before i do the rsync as per the man pages or will it just use it by default since the destination is remote?

 

I have been looking to implement the bombich remote backup/sync method of backing up using rsync and also ssh along with public/private keys. This will alow me to schedule the process without any need for authentication.

 

I have updated to rsync 3.0.5 as per the tutorial and have added a public/private key (in a test environment). All i need to do now is test the wrapper script and add it to cron. I think thats all that is left. And then to put it into production.

Posted
Hello Mark

 

Have just come across this thread. What you could try is:

 

rsync -avz /Volumes/Raid-Main /Volumes/Raid_Backup

 

This should recursively transfer all files from /Volumes/Raid-Main on the source node into the destination directory on the remote node. Files should be transferred in archive mode. Hopefully preserving symbolic links, attributes & permissions etc. during the transfer. You should even get a bit of compression thrown in.

 

Rysnc uses ssh to make remote transfers. What that means is ssh should be installed at both ends. If both nodes are macs then it should be there in the default binaries. You're not limited to ssh either as you can use remsh or even rsh. Other alternatives are ditto and asr. Consult the manual pages for usage.

 

Not quite, your line is for duplicating between two local directories. This syntax copies from local to 'machine' using SSH:

 

rsync -avz /Volumes/Raid-Main machine:/Volumes/Raid_Backup

 

But I would just selectively copy what you actually need, not the base system, e.g.:

 

rsync -avz /path/to/joomla machine:/remote/path/to/backup/to

 

Do i need to start SSH first before i do the rsync as per the man pages or will it just use it by default since the destination is remote?

 

No, rsync will use SSH as and when it needs, and SSH will prompt for authentication details as required.

Posted

Hello Mark

 

It looks like powdarrmonkey has cleared this up nicely for the pair of us. Just be aware that cron has been superceded by launchd. Although cron should still be usable in 10.5 the recommendation is to use launchd/launchctl. There is a nice GUI front-end to this if you did not already know available from here:

 

Tuppis - Lingon by Peter Borg

 

 

Hello Powdarrmonkey

 

My thanks for correcting the typo. Out of a matter of interest in OP's case would you recommend rsync over ditto or possibly even asr?

 

Antonio Rocco (ACSA)

Posted

My thanks for correcting the typo. Out of a matter of interest in OP's case would you recommend rsync over ditto or possibly even asr?

 

I couldn't say, I have no experience with either of them (I spend most of my time at a Debian shell). I would say, though, that the proper rsync daemon is considerably faster than doing it over ssh because it copies file deltas, not the whole thing. From what I've read about ditto and asr, it sounds like they make full-file copies.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...