0

I've got an rsync job which I have been using over the course of several years. I'm a windows user and use Delta Copy Client.

This job has become so messy that it errors out all the time and I've recently discovered that it is not even copying certain new files (it probably bombs out after the errors and retries).

In a nutshell, I want to start with a clean slate.

Is it possible to?:

  1. delete the target bak folder on my NAS
  2. start the job anew

My concern is that I don't want to accidentally delete source files in the event that it does some kind of mirroring thing.

2nd question - one of the things which seems to cause me grief is the recycle bin ($RECYCLE.BIN). Is this something I can exclude with --exclude.

The command which the client runs is:

rsync.exe  -v -rlt -z --chmod=a=rw,Da+x --delete --exclude="CollegeBAK/" --exclude="Microsoft.Cpp/" --exclude="MSOCache/" --exclude="NaturallySpeaking/" --exclude="Documents/Dave/Onedrive/" --exclude="OneDriveTemp/" --exclude="Profile Files/" --exclude="Program Files/" --exclude="Program Files (x86)/" --exclude="ProgramData/" --exclude="Programmer Books" --exclude="Temp/" --exclude="Users/" --exclude="Windows/" --exclude="zz/Docos/" --exclude="node_modules*" --exclude=".vs/" --exclude="bin/Debug/" --exclude="bin/Release/" --exclude="obj/" --exclude="/Sql Server Logs/MALT_1.ldf" --exclude="**/Microsoft.Data.Services.Client.5.6.0/" --exclude="**/NewRelic.Azure.WebSites.x64.3.10.43.0/" --exclude="**/Microsoft.Diagnostics.Instrumentation.Extensions.Intercept.0.13.0-build22724/" --exclude="**/$RDKCLHB.Docs-master/" --exclude="**/My Music/FromJames/" --exclude="**/aspnetcore/fundamentals/host/" --exclude="**/BankWebinars/packages/" --exclude="**/CUMailer/CUWebinars.Azure.AdhocNotifier/" --exclude="**/TTSWebJobs/CUWebinars.Azure.EmailParser/" --exclude="Documents/Dave/dwhelper/Tax/" "/cygdrive/E//" "[email protected]::EBakII/EDrive//"   

Thanks

2 Answers 2

1

A partial answer (I only use rsync under Linux).

You can safely blow away the target and rsync will start the copy anew. Think of rsync more like "intelligent resumable copy" - ie it does not delete the source data.

I can't answer definitively whether you can exclude $RECYCLE.BIN, but I can't see a reason why you would not be able to do this.

1
  • Thanks. I'm not hardcore on these things, so I was very unsure of it. Might do a test run with a separate job. Cheers. Commented Jun 16, 2022 at 4:54
1

Also linux guy here, but you should be able to a) put your list of exclude files/directories into one file (exclude.txt) and pass that as one argument (rsync ... --exclude-from=exclude.txt), rather than listing them all at the CLI.

Also the options I would generally use for a backup are -av (and --delete is fine too) though not sure if these behave the same under windows. You can use -n to test what it will do.

Also, and it's kind of important, work out WHY (I'm going to go ahead and blame windows) it has become so messy, and WHAT errors??

Also since it seems you just want to back up user data (I didn't read your entire list of exclusions but it looks like OS stuff)...Why not just back that up?

Also, I'd consider doing it from a live linux env, for all kinds of sanity.

man rsync or whatever the windows equivalent is, should answer most of your questions, it's pretty comprehensive.

And yes, you can nuke the target directory and rsync will copy everything anew, it does not reverse-sync unless told to. (thus the SRC and DEST being specified)

4
  • thanks! Good advice there. Will definitely look at using a text file for excludes. I did try to work out why, but was not able to resolve anything. Sometimes paths were too long. Other times I kept getting a "file vanished" message, which a Google search did not really help me find an answer to. A lot of issues were things which were in the Windows recycle bin, which seems to be a hidden directory on Windows data drives. If I can carve that out, would probably solve most problems. As for the excludes, I don't seem to have any issues with those. It's data I don't need backed up. Cheers. Commented Jun 16, 2022 at 22:48
  • Are you backing up to a FAT or NTFS partition? IIRC they have character limits (thus progra~1, etc, in windows notation) on file names. I would have thought NTFS had expanded that to a reasonable length. Everything will be transparent to a live linux distro so excluding recyclebin (whatever it's true path is) is trivial. My point in saying that was, rather than -excluding- a long list of things, why not -only- rsync whatever the windows /user directory is (/home/user/documents and settings, or something)
    – mitts
    Commented Jun 17, 2022 at 6:45
  • I'm backing up to disks with EXT4 (a QNAP TS-412). But the source drive is NTFS. I don't really store any data in the Windows User directory. Any data which is stored there gets sync'd to Onedrive, rendering the need to back up to my NAS nugatory. Commented Jun 18, 2022 at 23:54
  • I came across an example of an error I cannot resolve. It says, cannot delete non-empty directory: @eaDir . This is odd to me as there is no such directory on either the source or the target drive. Do you have any idea how to resolve that? Commented Jun 24, 2022 at 3:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .