I am rsyncing some files to cloud for backup
one of the files has a long file name and has a ? mark in the name which makes rsync stop after failing to copy this file
i tried to copy it using the cp command but could not do it. it was intersting to see that the ? was translated as "at sign" in the cp command and at the end the output said that it could not copy the file because there is no such file or directory it was strangly and making the situation even worse , traslating the initial ? as / thus thinking that file 123?s2 has to be copied to 123/s2
anyways, i can change the file name however do you know how you can tell rsync to continue with the rsync regardless of any errors?
What does it report, if anything, when it stops? In my experience, rsync will continue after an error, it just won't execute a --delete option in that case (unless --ignore-errors is specified).
well the issue is that I can not rename the file, it is used by website and the file has ? in the name which can not be even copied to the destination using cp or scp so i guess the receiver does not accept that character.
i guess i am lazy and will also search google it but how can you tell rsync to sync a folder for example /1 but exclude 1/2 and 1/3. in another word tell rsync to sync a root folder but exclude some of its sub folder
I know there is a pattern command for this but don't think that will be very useful as there are no patterns but the absolute folder path
thanks to all posters
?? Use the absolute folder path in an "exclude=". You can have multiple "exclude=", BTW. An absolute path is a pattern, BTW, it just calls for an exact character match.
Originally Posted by linux44
To exclude stuff, simple use the "--exclude path-pattern-or-pattern-file". IE,
Do read the rsync man page or info file. They should tell you everything you really need to know.
rsync --exclude '/1/2' --exclude '1/3' --exclude file-with-patterns-to-exclude
We should all read the manpage. In RHEL5 at least, it's "exclude-from" for a file containing patterns The syntax given would exclude the file from the backup graph, rather than its contents. Since the manpage says "exclude=" and "exclude-from=", I also thought the example was broken without the equal sign. But it works fine without the =.
Ach... vell... I am running an RHEL 6.x based system, so as the saying goes, your mileage may vary! -) Since there are often such little inconvenient versionitis issues with software these days, checking for the supported syntax on your specific system is always a good idea!