Help - rdiff-backup removing permision on target folder

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

Help - rdiff-backup removing permision on target folder

ron89
I'm been stumped by a problem for days.

I use nothing but linux and have been using rdiff-backup for years to backup all my machines to one central server.  I use the traditional method of the central server reaching out using ssh.

A friend wanted me to setup a backup of their windows machine to a linux server.
I tested this at home by making windows machine with cygwin on it.
It works just like my linux clients where the central backup server reaches out with ssh.
It works great.

I then setup a linux server and windows machine at the friends house.  As far as I can tell, the setup is (almost) identical to my test system at home.

I setup the linux server at the frien's house the same as my home system. I have a user called rbackup that performs the backup.  I pre-created the destination/target folder and made rbackup the owner.  When rdiff-backup runs for the first time, it does a complete backup successfully.  However, for some reason,when rdiff-backup is finished, it removes some permissions from the root of the destination folder.

The permissions change from:
drwxr-xr-x
to
drwx------

The next time rdiff-backup runs, it fails with many permission errors.
For example, it says permission denied for (rdiff-backup-data/mirror_metadata.2014-05-23T23:47:46-05:00.snapshot.gz).
The reason for this seems to be because (at some point in this second backup) rdiff-backup removed even more permissions from the root of the target folder.
They end up as:
d---------

Firstly, why is rdiff-backup making modifications to the root of the target folder?
Secondly, why does it do the most asenine thing that it can possibly do by removing all the permissions?

As a test, on the system with the problem, I tried to run a local backup.  That is, the central server makes an ssh connection to itself to run a backup.  This backup runs fine and does not modify the root of the target folder.

I gather I must have some difference between my test system (at home) which works, and this troublesome system, but I can't finger it out!

Any ideas?

Thanks.

+----------------------------------------------------------------------
|This was sent by [hidden email] via Backup Central.
|Forward SPAM to [hidden email].
+----------------------------------------------------------------------



_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: Help - rdiff-backup removing permision on target folder

Dominic Raferd-3
Can you give us a bit more informationj? What is the full rdiff-backup
line that apparently causes the problem? What linux os are you running
on the server?

On 24/05/2014 05:57, bt101 wrote:

> I'm been stumped by a problem for days.
>
> I use nothing but linux and have been using rdiff-backup for years to backup all my machines to one central server.  I use the traditional method of the central server reaching out using ssh.
>
> A friend wanted me to setup a backup of their windows machine to a linux server.
> I tested this at home by making windows machine with cygwin on it.
> It works just like my linux clients where the central backup server reaches out with ssh.
> It works great.
>
> I then setup a linux server and windows machine at the friends house.  As far as I can tell, the setup is (almost) identical to my test system at home.
>
> I setup the linux server at the frien's house the same as my home system. I have a user called rbackup that performs the backup.  I pre-created the destination/target folder and made rbackup the owner.  When rdiff-backup runs for the first time, it does a complete backup successfully.  However, for some reason,when rdiff-backup is finished, it removes some permissions from the root of the destination folder.
>
> The permissions change from:
> drwxr-xr-x
> to
> drwx------
>
> The next time rdiff-backup runs, it fails with many permission errors.
> For example, it says permission denied for (rdiff-backup-data/mirror_metadata.2014-05-23T23:47:46-05:00.snapshot.gz).
> The reason for this seems to be because (at some point in this second backup) rdiff-backup removed even more permissions from the root of the target folder.
> They end up as:
> d---------
>
> Firstly, why is rdiff-backup making modifications to the root of the target folder?
> Secondly, why does it do the most asenine thing that it can possibly do by removing all the permissions?
>
> As a test, on the system with the problem, I tried to run a local backup.  That is, the central server makes an ssh connection to itself to run a backup.  This backup runs fine and does not modify the root of the target folder.
>
> I gather I must have some difference between my test system (at home) which works, and this troublesome system, but I can't finger it out!
>
> Any ideas?
>
> Thanks.

_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Help - rdiff-backup removing permision on target folder

ron89
In reply to this post by ron89
Yes, the OS of the central backup server is Ubuntu 10.04.

For the error messages...
There is no error message generated for the first run.  It runs all the way through the backup with no error message.

For the second run, I have posted the complete output of verbosity=5 below.  I could be completely wrong but I don't there is any information in the output that can help though.  The really relevant part is that rdiff-backup is slitting its own throat by removing permissions on that target folder.  If anybody has any idea why it would be touching that folder (aside from putting the backup in it), then let me know.

Just for clarity, the root of the target folder is:
/mnt/usb1/backup/rdiffbackup/win7_c_home

Here is the output from the second run:
-------------------------------------
Using rdiff-backup version 1.2.8
Executing ssh -C win7-rbackup rdiff-backup --server
Unable to import module xattr.
Extended attributes not supported on filesystem at /
Unable to import module posix1e from pylibacl package.
POSIX ACLs not supported on filesystem at /
Unable to import win32security module. Windows ACLs
not supported by filesystem at /
escape_dos_devices not required by filesystem at /
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
  Access control lists                         Off
  Extended attributes                          Off
  Windows access control lists                 Off
  Case sensitivity                             Off
  Escape DOS devices                           Off
  Escape trailing spaces                       Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Extended attributes not supported by filesystem at /mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/rdiff-backup.tmp.0
POSIX ACLs not supported by filesystem at /mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/rdiff-backup.tmp.0
Unable to import win32security module. Windows ACLs
not supported by filesystem at /mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/rdiff-backup.tmp.0
escape_dos_devices not required by filesystem at /mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           Off
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         Off
  Extended attributes                          Off
  Windows access control lists                 Off
  Case sensitivity                             On
  Escape DOS devices                           Off
  Escape trailing spaces                       Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Reading globbing filelist /home/rbackup/dev/backup/rdiffinclude_win7_c_home.txt
Starting increment operation / to /mnt/usb1/backup/rdiffbackup/win7_c_home
Processing changed file .
Incrementing mirror file /mnt/usb1/backup/rdiffbackup/win7_c_home
Processing changed file cygdrive
Incrementing mirror file /mnt/usb1/backup/rdiffbackup/win7_c_home/cygdrive
Exception '[Errno 13] Permission denied: '/mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/mirror_metadata.2014-05-23T23:47:46-05:00.snapshot.gz'' raised of class '<type 'exceptions.OSError'>':
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 324, in Main
    take_action(rps)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 280, in take_action
    elif action == "backup": Backup(rps[0], rps[1])
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 343, in Backup
    backup.Mirror_and_increment(rpin, rpout, incdir)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 51, in Mirror_and_increment
    DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 245, in patch_and_increment
    cls.CCPP.close()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 490, in close
    self.metawriter.close()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/metadata.py", line 421, in close
    self.rp.fsync_with_dir()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1314, in fsync_with_dir
    self.fsync(fp)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1276, in fsync
    if not fp: self.conn.rpath.RPath.fsync_local(self)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1303, in fsync_local
    self.setdata()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 908, in setdata
    self.data = self.conn.rpath.make_file_dict(self.path)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 287, in make_file_dict
    return C.make_file_dict(filename)

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/pymodules/python2.6/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 324, in Main
    take_action(rps)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 280, in take_action
    elif action == "backup": Backup(rps[0], rps[1])
  File "/usr/lib/pymodules/python2.6/rdiff_backup/Main.py", line 343, in Backup
    backup.Mirror_and_increment(rpin, rpout, incdir)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 51, in Mirror_and_increment
    DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 245, in patch_and_increment
    cls.CCPP.close()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/backup.py", line 490, in close
    self.metawriter.close()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/metadata.py", line 421, in close
    self.rp.fsync_with_dir()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1314, in fsync_with_dir
    self.fsync(fp)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1276, in fsync
    if not fp: self.conn.rpath.RPath.fsync_local(self)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 1303, in fsync_local
    self.setdata()
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 908, in setdata
    self.data = self.conn.rpath.make_file_dict(self.path)
  File "/usr/lib/pymodules/python2.6/rdiff_backup/rpath.py", line 287, in make_file_dict
    return C.make_file_dict(filename)
OSError: [Errno 13] Permission denied: '/mnt/usb1/backup/rdiffbackup/win7_c_home/rdiff-backup-data/mirror_metadata.2014-05-23T23:47:46-05:00.snapshot.gz'

+----------------------------------------------------------------------
|This was sent by [hidden email] via Backup Central.
|Forward SPAM to [hidden email].
+----------------------------------------------------------------------



_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Help - rdiff-backup removing permision on target folder

ron89
In reply to this post by ron89
Ok solved it.. "sorta".

I ran rdiff-backup with verbosity=9.  One of the last thing it does is copy permissions and time stamps from the source folders to the target folders.  The very last folder it does is the root of your target folder.  You would think that rdiff-backup would only treat the target folder as a container for the backup as well as the rdiff-backup specific control folder.  That way rdiff-backup could ALWAYS get to its control folder.  Instead, it treats that root of the taget folder as part of the backup and changes its permissions to match the root of your source directory, which (if your source directory has no permissions) could potentially cut-off access to the rdiff-backup control directory.

I logged-in the the cygwin machines via ssh.
Went to the root folder (cd /).
When I did an (ls -al), the good/test system showed various permissions on the (.) and (..) folder.  The bad system showed none/blank permissions.  I have no idea why the cygwin root folder ended up with different permissions on each system.

One option is to not do the backup from (/) but rather from (/cygdrive).  The worked OK as the cygdrive folder did not have blank permissions.  However I still wanted to backup from (/) since all my other backups did this.

Instead, I just changed the permissions on the (/) of cygwin.

To get to the cygwin root folder, I went through the cygdrive path (cd /cygdrive/c/path_to_cygwin_dir).  I then did an (ls -al) and it showed the same blank permissions as viewed from the (/) dir as described above.  At that location, I just did a chmod of the permissions to match the good/test system.  I verified the permission changes by going back to the (/) dir and doing an (ls -al).

So be aware that rdiff-backup can kill its access to its own control folder.  It should really put the backup folders and the control folder inside the root of the target folder at the same level and not make modifications to the permissions of the target folder.

+----------------------------------------------------------------------
|This was sent by [hidden email] via Backup Central.
|Forward SPAM to [hidden email].
+----------------------------------------------------------------------



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