Find the answer to your Linux question:
Results 1 to 8 of 8
Hello All, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    13

    rsync issue


    Hello All,

    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?

    thanks

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    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).

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,578
    Rename the file.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Nov 2011
    Posts
    13
    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

  5. #5
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    Quote Originally Posted by linux44 View Post
    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.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,578
    To exclude stuff, simple use the "--exclude path-pattern-or-pattern-file". IE,
    Code:
    rsync --exclude '/1/2' --exclude '1/3' --exclude file-with-patterns-to-exclude
    Do read the rsync man page or info file. They should tell you everything you really need to know.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    664
    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 =.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,578
    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!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •