Results 1 to 5 of 5

Thread: rsync --suffix query

  1. #1
    Join Date
    Dec 2006
    Beans
    794

    rsync --suffix query

    I run the following in the terminal:

    Code:
    /testA$ rsync -avr --suffix=_`date +"%m%d%Y_%H%M"` fileA.txt /testB/
    In directory testB, I expect to find (a time-stamped):

    fileA.txt_12212012_1015

    Instead, in directory testB, I find (a non-time-stamped):

    fileA.txt

    Any thoughts?
    Last edited by maclenin; December 22nd, 2012 at 03:04 PM.

  2. #2
    Join Date
    Dec 2006
    Beans
    794

    Re: rsync --suffix query

    I stumbled upon my own oversight. All is fine with the rsync statement, as written. In my testy haste, I had forgotten to modify the contents of fileA.txt between runs....

    HNY!

  3. #3
    Join Date
    Apr 2007
    Beans
    3,114
    Distro
    Ubuntu

    Re: rsync --suffix query

    You do not need the -r option as it is already part of the -a option. Yet, it does not hurt adding it, of course.

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: rsync --suffix query

    I need the --backup option too:
    Code:
    rsync -av --backup --suffix=_`date +"%m%d%Y_%H%M"` "/home/$USER/test/ttt/" "/home/$USER/test/tbup/"

  5. #5
    Join Date
    Dec 2006
    Beans
    794

    Re: rsync --suffix query

    vanadium!

    Indeed, I had missed the "r" buried in the "a"....

    sudodus!

    After I discovered my "oversight", I was able to run my original statement without the -b (--backup) option and the added --suffix option still applied the date / time stamp, as defined.

    Perhaps, the --suffix and --backup-dir options, when used in combination with the -b option redfine the -b defaults. However, --suffix, as seems to be the case in my original statement, can be used without -b to rename a changed destination file. Whereas, --backup-dir cannot be used independently of -b.

    Thanks, again, for the guidance.
    Last edited by maclenin; December 23rd, 2012 at 11:46 AM.

Bookmarks

Posting Permissions

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