tags:

views:

210

answers:

1
rsync -auve ssh --backup --suffix='2008-10-03-1514539' --backup-dir='/tmp/' module.pm root@web1:/path/to/module.pm

I run this command without the --backup-dir option and when it copies the file over, it creates a backup with a current timestamp. When I include the --backup-dir option, it makes the backup into the /tmp/ directory but never attaches my suffix.

There is nothing in the manual to suggest that you can't use both these options together. I've played around with the order also and nothing seems to fix it.

Does anyone have a solution to this?

+1  A: 

the manual says:

--backup make backups (see --suffix & --backup-dir)

--backup-dir=DIR make backups into hierarchy based in DIR

--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)

so it seems that you can use one or the other, not both (as I guess you want a way to determine what's a backup you use a suffix or a directory).

As a way to fix this, why don't you keep the suffix and modify the destination to include the backup directory.

gbjbaanb
From what I can see, the manual is saying that the --suffix option defaults to "~" without a --backup-dir (which it does). When you specify a backup-dir, then it "defaults" to an empty string, but you should still be able to specify a custom one.
David McLaughlin
Have you tried changing order of the parameters ?
hayalci
yeah i did, as i mentioned in the question.
David McLaughlin
possibly, but I read it as "default suffix is ~, unless you have used the backup dir option instead". Its not clear.
gbjbaanb