HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   rsync: how to copy file that is not permissible (http://www.howtoforge.com/forums/showthread.php?t=29268)

nugroho2 5th December 2008 17:56

rsync: how to copy file that is not permissible
 
I have run incremental backup using rsync successfully after reading from one site but I could not copy many system files because "permission denied" etc. So I just exclude the folders through the excluded files.
Does this mean that rsync has that limitation? I had run as superuser.
I have read the manual, but still could not find the way to copy all system files using rsync. I have used dd command successfully to do that.

sjau 5th December 2008 18:49

not all files really exist... e.g. /proc just appears but they are not true files...

nugroho2 6th December 2008 02:37

Thanks for the fast reply.

My code is something like this:
Quote:

$RSYNC \
-av --delete --delete-excluded \
--exclude-from="$EXCLUDES" \
/lib/ $SNAPSHOT/lib ;
and the failure is mostly caused by chgrp and chown, like this:

Quote:

rsync: chgrp "/media/ACERONE/lib/modules/2.6.23.9lw/usb" failed: Operation not permitted (1)
rsync: chgrp "/media/ACERONE/lib/modules/2.6.23.9lw/usb/media" failed: Operation not permitted (1)
rsync: chown "/media/ACERONE/lib/rtkaio" failed: Operation not permitted (1)
rsync: chown "/media/ACERONE/lib/security" failed: Operation not permitted (1)
rsync: chown "/media/ACERONE/lib/security/pam_filter" failed: Operation not permitted (1)
How do you work around the problem?

sjau 6th December 2008 08:39

what filesystem is the ACERONE?

nugroho2 6th December 2008 11:34

Linpus, based on Fedora 8.

sjau 6th December 2008 18:20

but what filesystem is in place there?

nugroho2 7th December 2008 06:11

/dev/sda1 ... ext2
/dev/sda2 ... linux-swap

My code rsync the "/" folder. Perhaps that includes the sda2 ?

falko 7th December 2008 14:51

No, sda2 is your swap partition - you don't have to rsync that. It is used by your computer if there's not enough RAM.

nugroho2 8th December 2008 06:21

The source is ext2, the destination is also ext2. Perhaps this is related to group and owner of destination folder? How should I get around this?

geek.de.nz 8th December 2008 10:09

dirvish
 
Hi,

Why don't you use a backup system like dirvish? It has served me well for quite some time now.

Otherwise (or also with dirvish) you will need to exclude device and virtual files like those, maybe in a exclude file (e.g. rsync_exclude.txt):

Code:

/path/to/file/from/directory/rsync/is/run
path/to/file/which/is/in/any/sub/directory
path/to/directory/
/path/to/directory/
path/to/directory/** #to exclude every file under directory
/other/pattern/???directorybeginningwithany3characters/and/fileendingwithanything*
+ path/to/file/to/keep/excluded/before/or/after
# ...
# unfortunately no regular expressions...

and then run with
Code:

rsync --exclude-from=rsync_exclude.txt ...
You can look up the dirvish docs, but i found rsync quite challenging to get it to do exactly what i want... :)


All times are GMT +2. The time now is 09:33.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.