Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what is wrong with my rsync syntax?

0 views
Skip to first unread message

ToddAn...@verizon.net

unread,
Jun 8, 2007, 2:56:51 PM6/8/07
to
Hi All,

I am trying to rsync thee local directories to a USB
memory stick on the same machine. Eventually, I want
to implement rsync's "--delete" command to make sure the
USB stick doesn't fill with defunct stuff.

But, I can not seem to get the following command to work:

rsync -avr '/home/CDs/Linux /home/CDs/Internet /home/CDs/
Drivers' /mnt/CDs/.

I can get any of the three to work by themselves

rsync -avr '/home/CDs/Linux' /mnt/CDs/.

But, not together.

I though I was following the man page to the letter! What
am I doing wrong?

Many thanks,
-T

Robert M. Riches Jr.

unread,
Jun 8, 2007, 3:04:50 PM6/8/07
to

If you are really trying to copy three subdirectories of
under /home/CDs, then I would suggest getting rid of the
quotation marks. The quotation marks say to use a _single_
path that contains spaces.

--
Robert Riches
spamt...@verizon.net
(Yes, that is one of my email addresses.)

ToddAn...@verizon.net

unread,
Jun 8, 2007, 3:25:22 PM6/8/07
to
On Jun 8, 12:04 pm, "Robert M. Riches Jr." <spamtra...@verizon.net>
wrote:

> On 2007-06-08, ToddAndMa...@verizon.net <ToddAndMa...@verizon.net> wrote:
>
>
>
> > Hi All,
>
> > I am trying to rsync thee local directories to a USB
> > memory stick on the same machine. Eventually, I want
> > to implement rsync's "--delete" command to make sure the
> > USB stick doesn't fill with defunct stuff.
>
> > But, I can not seem to get the following command to work:
>
> > rsync -avr '/home/CDs/Linux /home/CDs/Internet /home/CDs/
> > Drivers' /mnt/CDs/.
>
> > I can get any of the three to work by themselves
>
> > rsync -avr '/home/CDs/Linux' /mnt/CDs/.
>
> > But, not together.
>
> > I though I was following the man page to the letter! What
> > am I doing wrong?
>
> If you are really trying to copy three subdirectories of
> under /home/CDs, then I would suggest getting rid of the
> quotation marks. The quotation marks say to use a _single_
> path that contains spaces.
>

Hi Robert,

I tried

rsync -vr --dry-run /home/CDs/Linux /home/CDs/Internet /home/CDs/
Drivers /mnt/CDs/.

Got back "too many arguments". It only recognized /home/CDs/Linux and
probably
transferred it to /home/CDs/Internet.

The man page states:

The syntax for requesting multiple files from a remote host
involves
using quoted spaces in the SRC. Some examples:

rsync host::'modname/dir1/file1 modname/dir2/file2' /
dest

This would copy file1 and file2 into /dest from an rsync
daemon.

What am I doing wrong?

-T

Robert M. Riches Jr.

unread,
Jun 8, 2007, 4:16:26 PM6/8/07
to

Too many arguments, huh? My man page says

SYNOPSIS
rsync [OPTION]... SRC [SRC]... DEST
...

which indicates it _should_ take a number of source files
followed by one destination file. You've stumped me, but
then that's not too difficult to do.

CptDondo

unread,
Jun 8, 2007, 4:43:43 PM6/8/07
to


You need to read the section where the manpage describes the different
modes.

Basically, the quoted form is correct IFF you are connecting to a remote
server.

The unquoted form is correct IFF you are using rsync as an inteligent
local copy.

So... back to the OP - what mode did you use? the command you gave
first should have worked.

--Yan

ToddAn...@verizon.net

unread,
Jun 8, 2007, 5:14:30 PM6/8/07
to

I have no idea what you just said. :'(

I am trying to copy three directories on my local computer to
a USB memory stick on the same local computer.

Both single quoted and unquoted give me error messages.
Would you look at my prior posts on the thread and
see where I am goofing things?

-T

ToddAn...@verizon.net

unread,
Jun 8, 2007, 5:49:27 PM6/8/07
to
I am starting to wonder if this can be done. I looked at

http://www.samba.org/rsync/examples.html

and found:

backup to a spare disk


I do local backups on several of my machines using rsync. I have an
extra disk installed that can hold all the contents of the main
disk. I then have a nightly cron job that backs up the main disk to
the backup. This is the script I use on one of those machines.

#!/bin/sh
export PATH=/usr/local/bin:/usr/bin:/bin
LIST="rootfs usr data data2"
for d in $LIST; do
mount /backup/$d
rsync -ax --exclude fstab --delete /$d/ /backup/$d/
umount /backup/$d
done
DAY=`date "+%A"`
rsync -a --delete /usr/local/apache /data2/backups/$DAY
rsync -a --delete /data/solid /data2/backups/$DAY

The writer would not be using a "do" loop if directories could
be put together like I am trying. I will just split my line up into
three.

I appreciate everyone's help.

-T

IsaacKuo

unread,
Jun 8, 2007, 6:01:52 PM6/8/07
to
On Jun 8, 4:49 pm, ToddAndMa...@verizon.net wrote:
> I am starting to wonder if this can be done. I looked at

> The writer would not be using a "do" loop if directories could


> be put together like I am trying. I will just split my line up into
> three.

For what it's worth, I use rsync in local mode like you're
doing for all sorts of backups. I only backup one directory
per script line. I never considered putting more than one
per script line; for me having just one per line is more
convenient since I can trivially pick and choose which
directories to backup by commenting/uncommenting lines.

Isaac Kuo

CptDondo

unread,
Jun 8, 2007, 6:38:57 PM6/8/07
to
ToddAn...@verizon.net wrote:

>
> I have no idea what you just said. :'(

rsync has 3 modes:

ssh
server
local

>
> I am trying to copy three directories on my local computer to
> a USB memory stick on the same local computer.

Hmmm.... rsync src1 src2 src3 target works for me....

???

--Yan

ToddAn...@verizon.net

unread,
Jun 8, 2007, 8:00:37 PM6/8/07
to
On Jun 8, 3:38 pm, CptDondo <y...@NsOeSiPnAeMr.com> wrote:


I split them up into three. I worked, sort of. It copied for
a while and then corrupted the daylights out of my stick.
I just created:

https://bugzilla.samba.org/show_bug.cgi?id=4684

I can not win. :'(

-T

Dan Espen

unread,
Jun 8, 2007, 8:05:38 PM6/8/07
to
ToddAn...@verizon.net writes:

Copy/paste *exactly* what you typed and what you got as a result
to get better help.

ToddAn...@verizon.net

unread,
Jun 8, 2007, 8:19:17 PM6/8/07
to
On Jun 8, 5:05 pm, Dan Espen <dan...@MORE.mk.SPAMtelcordia.com> wrote:

Dan,

I just erased my partition, re-fsck.vfat'ed it, and tried it with
"cp". Still
corrupted. rsync is off the hook.

cp -R -u Drivers Internet Linux /mnt/MyCDs/.

Editorial comment: AAAAAHHHHHHHHHHHHHH!!!!

I clearly have a bad stick. I will be calling Imation's tech support.

I appreciate everyone's help,
-T

Alfred S. Krumbholz

unread,
Jun 10, 2007, 5:25:51 PM6/10/07
to
* ToddAn...@verizon.net wrote, On 08.06.2007 23:14:
> I am trying to copy three directories on my local computer to
> a USB memory stick on the same local computer.

There is another option --files-from= that does the job for me.

rsync -arv --delete --files-from=/path/to/backup.list / /path/to/backup

The backup.list file is a simple text file containing the sources for
rsync. Like this...

boot
etc
var/cache/apt
var/lib/apt
home/user

The root folder "/" is in the command line, so the lines in the list
file have no starting "/".

Grüße ;-)
Alfred

ToddAndMargo

unread,
Jun 11, 2007, 9:57:22 PM6/11/07
to

Thank you!!!

0 new messages