SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Filename with special character
Author Message
Post Filename with special character 
Hi all,

Rdiff-backup : 1.2.8
OS : Ubuntu 12.04 LTS X64
Pyhton : 2.7
Installed from Ubuntu Package

I have troubles find the good syntax to write filenames with special
characters in rdiff-backup command
(I searched the archives).

Here is an example :
rdiff-backup --exclude "/media/guillaume/archives/$RECYCLE.BIN"
/media/guillaume/archives /home/serveur/backup/guillaume/archives

I'm geetings errors like :
Exception '[Errno 1] Operation not permitted:
'/home/serveur/backup/guillaume/archives/$RECYCLE.BIN'' raised of class
'<type 'exceptions.OSError'>':
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
337, in Backup
backup_final_init(rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
501, in backup_final_init
checkdest_if_necessary(rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
920, in checkdest_if_necessary
dest_rp.conn.regress.Regress(dest_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
71, in Regress
for rf in iterate_meta_rfs(mirror_rp, inc_rpath): ITR(rf.index, rf)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
197, in iterate_meta_rfs
for raw_rf, metadata_rorp in collated:
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py",
line 92, in Collate2Iters
try: relem1 = riter1.next()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
175, in helper
for sub_sub_rf in helper(sub_rf):
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
171, in helper
mirror_rp.chmod(0700 | mirror_rp.getperms())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line
927, in chmod
self.conn.os.chmod(self.path, permissions & Globals.permission_mask)

Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 30, in <module>
rdiff_backup.Main.error_check_Main(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
337, in Backup
backup_final_init(rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
501, in backup_final_init
checkdest_if_necessary(rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line
920, in checkdest_if_necessary
dest_rp.conn.regress.Regress(dest_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
71, in Regress
for rf in iterate_meta_rfs(mirror_rp, inc_rpath): ITR(rf.index, rf)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
197, in iterate_meta_rfs
for raw_rf, metadata_rorp in collated:
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py",
line 92, in Collate2Iters
try: relem1 = riter1.next()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
175, in helper
for sub_sub_rf in helper(sub_rf):
File "/usr/lib/python2.7/dist-packages/rdiff_backup/regress.py", line
171, in helper
mirror_rp.chmod(0700 | mirror_rp.getperms())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line
927, in chmod
self.conn.os.chmod(self.path, permissions & Globals.permission_mask)
OSError: [Errno 1] Operation not permitted:
'/home/serveur/backup/guillaume/archives/$RECYCLE.BIN'

Thanks a lot if you can assist with this.
Nicolas

_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Post Filename with special character 
On 06/04/2012 04:41 PM, me < at > electronico.nc wrote:
Here is an example:
rdiff-backup --exclude "/media/guillaume/archives/$RECYCLE.BIN" /media/guillaume/archives /home/serveur/backup/guillaume/archives


With that syntax, the shell will expand the $RECYCLE variable, and, since
there is probably no variable by that name, the actual command executed
will be:

rdiff-backup --exclude "/media/guillaume/archives/.BIN" \
/media/guillaume/archives /home/serveur/backup/guillaume/archives

From the backtrace, it appears that rdiff-backup is backing up the file
with the literal name '$RECYCLE.BIN' and is having some problem setting
setting the permissions on that file in the archive. I've not been able
to reproduce the problem you are seeing.

Any time you are trying to run a command with arguments that include a
shell meta-character that need to be preserved literally, you should
enclose that argument in single quotes:

rdiff-backup --exclude '/media/guillaume/archives/$RECYCLE.BIN' ...

Often, the simpler alternative is to build a separate file containing
the names of files to exclude and then pass that to rdiff-backup with
the "--exclude-filelist" or "--exclude-globbing-filelist" option.

--
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.


_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Post Filename with special character 
Le 05/06/2012 09:56, Robert Nichols a écrit :
On 06/04/2012 04:41 PM, me < at > electronico.nc wrote:
Here is an example:
rdiff-backup --exclude "/media/guillaume/archives/$RECYCLE.BIN"
/media/guillaume/archives /home/serveur/backup/guillaume/archives


With that syntax, the shell will expand the $RECYCLE variable, and, since
there is probably no variable by that name, the actual command executed
will be:

rdiff-backup --exclude "/media/guillaume/archives/.BIN" \
/media/guillaume/archives /home/serveur/backup/guillaume/archives

From the backtrace, it appears that rdiff-backup is backing up the file
with the literal name '$RECYCLE.BIN' and is having some problem setting
setting the permissions on that file in the archive. I've not been able
to reproduce the problem you are seeing.

Any time you are trying to run a command with arguments that include a
shell meta-character that need to be preserved literally, you should
enclose that argument in single quotes:

rdiff-backup --exclude '/media/guillaume/archives/$RECYCLE.BIN' ...

Often, the simpler alternative is to build a separate file containing
the names of files to exclude and then pass that to rdiff-backup with
the "--exclude-filelist" or "--exclude-globbing-filelist" option.

Thanks Bob,
Discovered this as you was probably typing your answer.
Thanks again to have taken time to answer Smile
Nicolas

_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB