Ralf S. Hellersen wrote:
> Hello rsync users !
This is a newsgroup for shell-scripting, but I am told that tools that can
be used in shells are on-topic here, too.
> I would like to perform on my machine (192.168.2.100) the following
> process in order to get rid of the files on computer 192.168.2.103, but
> to have them moved and collected for further analyses in directory ~/old
> on the (remote) machine 192.168.2.103.
>
> # rsync --delete -av --progress /dat/Musik_Originale/ ro...@192.168.2.103:/
> dat/Musik_Originale/ --backup-dir=~/old ;
>
> The process is starting, deleting files, but the directory ~/old remains
> allways empty. This is not wanted.
>
> Creating a directory ~/old on machine 192.168.2.100 results either in an
> empty directory. Nor /dat/Musik_Originale/old neither /dat/old or
> even /home/a_user/old (on both computers) contained the wanted data.
>
> My search in different sources was not successfull, but I know
> there must be a solution.
RTFM:
,----[rsync(1)]
|
| --backup-dir=DIR
| In combination with the --backup option, this tells rsync to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| store all backups in the specified directory on the
| receiving side.
| This can be used for incremental backups. You can
| additionally specify a backup suffix using the --suffix
| option (otherwise the files backed up in the specified
| directory will keep their original filenames).
|
| Note that if you specify a relative path, the backup
| directory will be relative to the destination directory, so
| you probably want to specify either an absolute path or a
| path that starts with "../". If an rsync daemon is the
| receiver, the backup dir cannot go outside the module’s path
| hierarchy, so take extra care not to delete it or copy into
| it.
|
`----
> My questions are, did I use the correct syntax
I can see nothing wrong with the syntax, however I suggest that you use
options before positional arguments always. Not all tools observe POSIX
rules.
> and where is the mistake ?
As should be obvious to you now, you have forgotten to specify the
“--backup” option.
And there should be no whitespace before sentence-ending marks in English
(and other Germanic languages). BTW, there is de.comp.os.unix.shell, too.
> Where could I create this directory ~/old precisly ?
Per the man(ual) page, it would be created “on the receiving side”. As the
receiving side is your local filesystem, it should be created there.
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.