rsync stopped working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

rsync stopped working

Robert Holtzman
Running Debian 8.2, xfce 4.10, rsync 3.1.1-3. I just edited my backup script as follows:

#The first line deletes extraneous files. The second does not and is used for normal backups.

# rsync -vaHz --delete --exclude '/proc' --exclude '*.iso' --exclude '/sys' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
 /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop

# rsync -vaHz --exclude '/proc' --exclude '/sys' --exclude '*.iso' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
 /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop


##############################################################################################################################################


 rsync -vaHz --delete --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop

# rsync -vaHz --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop


The lines above the hash marks are the original script which worked flawlessly.

Also, I just changed to an exclude file ($HOME/exclude) as follows:

'/dev'
'/lost+found'
'/proc'
'/media'
'/tmp'
'/*./*iso'

My problem is that when I run the script I get this error message:

root@localhost:/home/holtzm# scripts/backup
scripts/backup: line 4: /.: Is a directory
scripts/backup: line 7: /.: Is a directory
sending incremental file list
rsync: mkdir "/media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]

Tried running searches w/ no luck. Checked all the docs I could find w/ no luck.

Obviously, I screwed something up with the changes.

Any pointers appreciated.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

Re: rsync stopped working

SATOH Fumiyasu-4
Hi,

At Wed, 20 Jan 2016 01:11:58 -0700,
Bob Holtzman wrote:
> Running Debian 8.2, xfce 4.10, rsync 3.1.1-3. I just edited my backup script as follows:

Your backup script is broken.

> #The first line deletes extraneous files. The second does not and is used for normal backups.
>
> # rsync -vaHz --delete --exclude '/proc' --exclude '*.iso' --exclude '/sys' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'

This is a comment. I love comment.

>  /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop

This is NOT a comment.

/bin/sh tries to invoke "/." as a command, but it fails.
Try the following on your shell to reproduce it:

  $ /bin/sh
  $ /. foo bar
  sh: /.: Is a directory

> # rsync -vaHz --exclude '/proc' --exclude '/sys' --exclude '*.iso' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
>  /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop

Ditto.

> ##############################################################################################################################################
>
>
>  rsync -vaHz --delete --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop

--exclude option takes an extended glob pattern, not a file path.
Use --exclude-from option instead and read rsync(1) manpage.

> Also, I just changed to an exclude file ($HOME/exclude) as follows:
>
> '/dev'
> '/lost+found'
> '/proc'
> '/media'
> '/tmp'
> '/*./*iso'

Remove all "'"s.

> My problem is that when I run the script I get this error message:
>
> root@localhost:/home/holtzm# scripts/backup
> scripts/backup: line 4: /.: Is a directory
> scripts/backup: line 7: /.: Is a directory

See above.

> sending incremental file list
> rsync: mkdir "/media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop" failed: No such file or directory (2)
> rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]

Create /media/cf0a98ed-3c11-4107-b61e-f5139d024396 before running rsync.
Rsync does NOT create the parent directory of the destination.

> Tried running searches w/ no luck. Checked all the docs I could find w/ no luc

--
-- Name: SATOH Fumiyasu @ OSS Technology Corp. (fumiyas @ osstech co jp)
-- Business Home: http://www.OSSTech.co.jp/
-- GitHub Home: https://GitHub.com/fumiyas/
-- PGP Fingerprint: BBE1 A1C9 525A 292E 6729  CDEC ADC2 9DCA 5E1C CBCA

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Joe
Reply | Threaded
Open this post in threaded view
|

Re: rsync stopped working

Joe
In reply to this post by Robert Holtzman
I'm not a whiz at this, but a couple of things look odd.

1) Your exclude file is *probably* in /home/holtzm - not in /holtzm

2) I don't think your source should be /. (although it might be right -
but it looks like rsync doesn't like it). I think that /. ought to be
the same as /   . Usually it would be something like  /* or */ if you
were already in the root directory.

I think the problem is that rsync wants files to backup, not just a
directory. /* gives it files (including directories because -r
(recursive) is implied by -a).

You also have to be aware that using a source path without a trailing
slash gets you the top level directory (which often is not what you
want). Adding the trailing / gets all the files in the directory without
that top level.

Since you are using -v, you may want to consider also using -i which
gives you a lot of better information when something goes wrong.

I'm sure some of the experts on this list can explain the /. issue way
better than I did, but this may be enough to get you unstuck.

HTH

Joe

On 01/20/2016 03:11 AM, Bob Holtzman wrote:

> Running Debian 8.2, xfce 4.10, rsync 3.1.1-3. I just edited my backup script as follows:
>
> #The first line deletes extraneous files. The second does not and is used for normal backups.
>
> # rsync -vaHz --delete --exclude '/proc' --exclude '*.iso' --exclude '/sys' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
>   /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
> # rsync -vaHz --exclude '/proc' --exclude '/sys' --exclude '*.iso' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
>   /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
>
> ##############################################################################################################################################
>
>
>   rsync -vaHz --delete --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
> # rsync -vaHz --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
>
> The lines above the hash marks are the original script which worked flawlessly.
>
> Also, I just changed to an exclude file ($HOME/exclude) as follows:
>
> '/dev'
> '/lost+found'
> '/proc'
> '/media'
> '/tmp'
> '/*./*iso'
>
> My problem is that when I run the script I get this error message:
>
> root@localhost:/home/holtzm# scripts/backup
> scripts/backup: line 4: /.: Is a directory
> scripts/backup: line 7: /.: Is a directory
> sending incremental file list
> rsync: mkdir "/media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop" failed: No such file or directory (2)
> rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]
>
> Tried running searches w/ no luck. Checked all the docs I could find w/ no luck.
>
> Obviously, I screwed something up with the changes.
>
> Any pointers appreciated.
>


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

Re: rsync stopped working

Robert Holtzman
In reply to this post by SATOH Fumiyasu-4
On Wed, Jan 20, 2016 at 05:38:51PM +0900, SATOH Fumiyasu wrote:
> Hi,
>
> At Wed, 20 Jan 2016 01:11:58 -0700,
> Bob Holtzman wrote:
> > Running Debian 8.2, xfce 4.10, rsync 3.1.1-3. I just edited my backup script as follows:
>
> Your backup script is broken.

You've got me confused. The script line(s) you're telling me are broken are old ones out of use (notice the comment mark)
also my remark to the effect that the lines above the hash marks ........  

>
> > #The first line deletes extraneous files. The second does not and is used for normal backups.
> >
> > # rsync -vaHz --delete --exclude '/proc' --exclude '*.iso' --exclude '/sys' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
>
> This is a comment. I love comment.
>
> >  /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
> This is NOT a comment.

This is the result of my folding the lines manually. It's only for my post, not the real script which runs flawlessly.

>
> /bin/sh tries to invoke "/." as a command, but it fails.
> Try the following on your shell to reproduce it:
>
>   $ /bin/sh
>   $ /. foo bar
>   sh: /.: Is a directory
>
> > # rsync -vaHz --exclude '/proc' --exclude '/sys' --exclude '*.iso' --exclude '/home/holtzm/Documents/*.iso' --exclude '/media'
> >  /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
> Ditto.
>
> > ##############################################################################################################################################
> >
> >
> >  rsync -vaHz --delete --exclude '/holtzm/exclude' /. /media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop
>
> --exclude option takes an extended glob pattern, not a file path.
> Use --exclude-from option instead and read rsync(1) manpage.

That totally escaped me. Thanks.

>
> > Also, I just changed to an exclude file ($HOME/exclude) as follows:
> >
> > '/dev'
> > '/lost+found'
> > '/proc'
> > '/media'
> > '/tmp'
> > '/*./*iso'
>
> Remove all "'"s.

Noted.

>
> > My problem is that when I run the script I get this error message:
> >
> > root@localhost:/home/holtzm# scripts/backup
> > scripts/backup: line 4: /.: Is a directory
> > scripts/backup: line 7: /.: Is a directory
>
> See above.
>
> > sending incremental file list
> > rsync: mkdir "/media/cf0a98ed-3c11-4107-b61e-f5139d024396/Jessie-laptop" failed: No such file or directory (2)
> > rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]
>
> Create /media/cf0a98ed-3c11-4107-b61e-f5139d024396 before running rsync.
> Rsync does NOT create the parent directory of the destination.

I'm aware of that. The directory existed prior to my trying to run the script.


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html