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
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.)
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
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.
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
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
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
> 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
>
> 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
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
Copy/paste *exactly* what you typed and what you got as a result
to get better help.
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
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
Thank you!!!