-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yes, when it comes to local copies cp is significantly faster than rsync. Without --link-dest there isn't much advantage to using rsync for backups. The only thing you get beyond cp -au is --delete. Also, when it comes to static data like media files I like to keep an md5 file around with checksums for all the files. That way I can easily verify the files later on either the primary or backup storage and more importantly if they differ I can tell which one is correct. The cfv utility is great for file verifying. The -n option on it tells it to rename incorrect files. Then you can just do a simple rsync pass to delete the incorrectly named files and put back the now missing files. On 10/01/2015 01:53 AM, Perry Hutchison wrote:> "Ronald F. Guilmette" <rfg at tristatelogic.com> wrote: > >> P.S. I really do hope that I can get this to work with rsync. I >> do prefer not reinventing the wheel, but it is starting to seem >> simpler to me if I were to just write a Perl script that would >> walk two directory hierarchies, in parallel, and just repeatedly >> invoke the cmp command on all of the regular files found >> therein. > > Just because rsync is an awesome hammer, it does not necessarily > follow that every problem involving backups closely resembles a > nail :) > > Since your source and backup are both local, I suspect using rsync > as a comparison tool is overkill. (It may even be overkill for > making the backups in the first place.) Had you considered "diff > -q -r"? > > $ mkdir one two $ echo hello > one/hello $ ln one/hello two/hello $ > echo different0 > one/foo $ echo different1 > two/foo $ diff -q -r > one two Files one/foo and two/foo differ > > or, if you prefer > > $ diff -q -r -s one two Files one/foo and two/foo differ Files > one/hello and two/hello are identical > > (I'm using gnu diff; other variants might have different command > options.) >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlYM5wYACgkQVKC1jlbQAQdfRgCgkcyjw09g677+T+BUsdDWFb3c DwAAoL2q8+P/c8oolfNq9WEbhlIL2SvW =8K4f -----END PGP SIGNATURE-----
In message <560CE706.303 at sanitarium.net>, Kevin Korb <kmk at sanitarium.net> wrote:>Yes, when it comes to local copies cp is significantly faster than >rsync. Without --link-dest there isn't much advantage to using rsync >for backups. The only thing you get beyond cp -au is --delete.I just now remembered the (forehead slap) bloody obvious reason I decided to use rsync to make and maintain my backup drive(s). Yes, it theory I could have used something simpler... cp -R or else maybe cpio -p... but those just copy everything blindly. For my backups, I only need/want to have the NEW and/or MODIFIED files copied to the backup drive. (And also, of course, I need to have files that have been deleted on the main drive be deleted also on the backup drive.) Rsync does everything I want as far as making and maintaining backups. I could also have used FreeBSD backup & restore programs, but for reasons I can't really remember anymore, I concluded that rsync was the better option. Regards, rfg P.S. I have no idea what the -u option for cp is supposed to do. I guess that must be a Linux-ism. The FreeBSD man page for cp doesn't mention any such thing as a -u option.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 (GNU) cp -au is exactly equal to rsync -au. It won't copy files that are already up to date. It just doesn't have an equivalence to - --delete. Therefore, when doing local copies it is often faster to do a cp -au followed by an rsync --delete so that rsync is only bothering with the deletions. On 10/01/2015 04:48 PM, Ronald F. Guilmette wrote:> > In message <560CE706.303 at sanitarium.net>, Kevin Korb > <kmk at sanitarium.net> wrote: > >> Yes, when it comes to local copies cp is significantly faster >> than rsync. Without --link-dest there isn't much advantage to >> using rsync for backups. The only thing you get beyond cp -au is >> --delete. > > I just now remembered the (forehead slap) bloody obvious reason I > decided to use rsync to make and maintain my backup drive(s). > > Yes, it theory I could have used something simpler... cp -R or > else maybe cpio -p... but those just copy everything blindly. For > my backups, I only need/want to have the NEW and/or MODIFIED files > copied to the backup drive. (And also, of course, I need to have > files that have been deleted on the main drive be deleted also on > the backup drive.) > > Rsync does everything I want as far as making and maintaining > backups. I could also have used FreeBSD backup & restore programs, > but for reasons I can't really remember anymore, I concluded that > rsync was the better option. > > > Regards, rfg > > > P.S. I have no idea what the -u option for cp is supposed to do. I > guess that must be a Linux-ism. The FreeBSD man page for cp > doesn't mention any such thing as a -u option. >- -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlYNniEACgkQVKC1jlbQAQcMzwCfcb6FBPrnfE+EXWbUIoy3+GNN OiwAoKDju0x7yEhMGVkyV9q2kxsGI+6D =Ftfa -----END PGP SIGNATURE-----
Just chiming in slightly off topic. As a first step if you are going to be backing up files to some media with a computer it would be a really good idea to ensure, that the hardware being used is not faulty. I am not saying that your hardware is faulty. However, it would be worth checking this somehow. Check the drive media for bad blocks, check that all the cables are working well. Ensure the mother board of the system is in good working order etc. As a second step if you are going to be performing backups (with a file system based tool such as rsync) to any kind of file system in future, I would strongly suggest checking the file system is in a good state on a regular basis. File system corruption is capable of cause all sorts of problems for backup systems which rely upon the file system like rsync. Hope this helps. -------------------------------------------------------------------- This email is protected by LBackup, an open source backup solution http://www.lbackup.org On 2/10/2015, at 9:48 AM, Ronald F. Guilmette <rfg at tristatelogic.com> wrote:> > In message <560CE706.303 at sanitarium.net>, > Kevin Korb <kmk at sanitarium.net> wrote: > >> Yes, when it comes to local copies cp is significantly faster than >> rsync. Without --link-dest there isn't much advantage to using rsync >> for backups. The only thing you get beyond cp -au is --delete. > > I just now remembered the (forehead slap) bloody obvious reason I decided > to use rsync to make and maintain my backup drive(s). > > Yes, it theory I could have used something simpler... cp -R or else > maybe cpio -p... but those just copy everything blindly. For my > backups, I only need/want to have the NEW and/or MODIFIED files > copied to the backup drive. (And also, of course, I need to have > files that have been deleted on the main drive be deleted also on > the backup drive.) > > Rsync does everything I want as far as making and maintaining backups. > I could also have used FreeBSD backup & restore programs, but for > reasons I can't really remember anymore, I concluded that rsync was > the better option. > > > Regards, > rfg > > > P.S. I have no idea what the -u option for cp is supposed to do. > I guess that must be a Linux-ism. The FreeBSD man page for cp doesn't > mention any such thing as a -u option. > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html