[SOLVED] I found a minor flaw in my Rsync Back-Up strategy

You have a problem with Salix? Post here and we'll do what we can to help.
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: [SOLVED] I found a minor flaw in my Rsync Back-Up strate

Post by Shador »

That's a bad solution as it omits hidden files. Have a look at this article: http://www.sant-media.co.uk/2010/05/lin ... o-another/

The solution for just copying the contents with cp:

Code: Select all

cp -a /old/. /new
This actually copies the ./ directory to new/./ but as new/./ is the same as new/ it does exactly what we want.

For mv it's way more complicated involving find as outlined in the article.
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: [SOLVED] I found a minor flaw in my Rsync Back-Up strate

Post by mimosa »

Shador, that's an extremely helpful link. I'd forgotten about hidden files, but never came across the /. trick.
Post Reply