samba-bugs@samba.org
2008-Jul-12 17:01 UTC
DO NOT REPLY [Bug 4621] "-p" option to simulate "mkdir -p" for rsync
https://bugzilla.samba.org/show_bug.cgi?id=4621
tkessler@ucdavis.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkessler@ucdavis.edu
------- Comment #2 from tkessler@ucdavis.edu 2008-07-12 12:01 CST -------
This would be an EXCEPTIONALLY useful command/option to have implemented in
rsync. I am currently trying to implement a backup system which writes to an
available module called "rsyncbackup" on an rsync server. I want this
module to
be writable via rsync, but have it be read-only through SMB and other file
server protocols. I use the following command to invoke rsync:
rsync -rtglv --delete --delete-after --delete-excluded --progress --backup
--backup-dir=../../backups/$HOSTNAME/$DAYDATE/$HOURMINSEC/ ~/$USERNAME
server.domain.name::rsyncbackup/$USERNAME/current/$HOSTNAME
In my rsyncd.conf file, I have this entry for the "rsyncbackup"
module:
[rsyncbackup]
path = /Volumes/Burns1/rsyncbackup
hosts allow = ip_address
list = true
exclude from = /Volumes/Burns1/rsyncbackup/info/rsyncexclude.txt
auth users use chroot = yes
uid = serveradmin
gid = backupgrp
read only = false
write only = true
comment = rsync backup directory
The "rsyncbackup" folder itself is given these permissions:
serveradmin: read & write
backupgrp: read only
others: none
The "rsyncbackup" destination module starts out empty, and when I run
the
command on a client computer it gives an error such as:
rsync: mkdir "username/current/hostname" (in rsyncbackup)
failed: No
such file or directory (2).
All paths in the rsyncd.conf file exist, and the command works very well if I
leave out the "current/$HOSTNAME" part, but defining nonexistent
subfolders to
back up to causes this error and rsync doesnt continue. The only way around is
to manually create the folders.
It appears that rsync is invoking the "mkdir" command without the
"-p" option,
which limits its folder creation to only one directory, instead of allowing it
to create a tree of directories. It would be exceptionally useful if rsync
would supply the "-p" option to the mkdir command so it will create a
new tree
of folders and use that as the backup destination. Currently, I have to work
around this by sharing the rsync module with read and write permissions, and
have the command run on client computers via SMB to transfer files to the
server (bypassing the rsync server and using samba file sharing instead as the
means for transfer).
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jul-13 01:58 UTC
DO NOT REPLY [Bug 4621] "-p" option to simulate "mkdir -p" for rsync
https://bugzilla.samba.org/show_bug.cgi?id=4621 ------- Comment #3 from matt@mattmccutchen.net 2008-07-12 20:58 CST ------- If this option is added to rsync, I suggest calling it --create-dest-parents because -p is already taken. (In reply to comment #2)> It appears that rsync is invoking the "mkdir" command without the "-p" option, > which limits its folder creation to only one directory, instead of allowing it > to create a tree of directories.Note that rsync uses the mkdir(2) system call, not the mkdir(1) command, so it would have to loop over the parents of the destination itself. Two currently supported workarounds: 1. Cut off the portion of the destination path that needs to be created, and instead prepend it to the file-list paths of all the source files by accessing the source through an appropriately named symlink with --relative. 2. Run a "mkdir -p" command before rsync. If the destination is local, use a wrapper like the one in comment #1; if it's over remote shell, use --rsync-path; and if it's on a daemon, define a "pre-xfer exec" script that determines the destination directory from the RSYNC_* environment variables and creates it. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
Maybe Matching Threads
- DO NOT REPLY [Bug 4621] "-p" option to simulate "mkdir -p" for rsync
- DO NOT REPLY [Bug 4621] Option to create ancestors of destination, like "mkdir -p"
- rsync/jscript/cygwin problem
- Ensuring that rsync doesn't try to write to an unmounted drive
- Ensuring that rsync doesn't try to write to an unmounted drive