I have this in my rsync.conf [backup] path = /home/$USER/backup use chroot = no monge symlinks = no uid = wendell gid = wendell read only = no list = yes auth users = wendell secrets file = /etc/rsyncd.secrets But rsync doesn't seem to interpret the $USER. I've also tried this with $HOME and '~' with no luck. I want to be able to back up to the folder 'backup' that will be in the users homefolder when a user is backing up remotely to the rsync daemon. How can I do this? -------------- next part -------------- HTML attachment scrubbed and removed
On Mon, 2009-03-16 at 16:43 -0400, Jerome Hollon wrote:> I have this in my rsync.conf > [backup] > path = /home/$USER/backup > use chroot = no > monge symlinks = no > uid = wendell > gid = wendell > read only = no > list = yes > auth users = wendell > secrets file = /etc/rsyncd.secrets > But rsync doesn't seem to interpret the $USER. I've also tried this > with $HOME and '~' with no luck. I want to be able to back up to the > folder 'backup' that will be in the users homefolder when a user is > backing up remotely to the rsync daemon. > > How can I do this?Rsync does not perform any kind of expansion on module paths. The $USER environment variable would not be useful anyway (at least for a listening daemon) because it refers to the user running the daemon, not the client. IMO, having a module do completely different things depending on who accesses it is dodgy. I recommend using a separate module for each user. You can generate the configuration automatically with m4: define(`module', ` [backup-$1] path = /home/$USER/backup use chroot = no monge symlinks = no uid = $1 gid = $1 read only = no list = yes auth users = $1 secrets file = /etc/rsyncd.secrets ') module(`wendell') module(`jerome') (See also http://lists.samba.org/archive/rsync/2007-January/017014.html .) If your users have unrestricted shell accounts on the backup server, it may be appropriate to use plain rsync over ssh rather than a daemon. -- Matt
On 16-Mar-2009, at 14:43, Jerome Hollon wrote:> I have this in my rsync.conf > [backup] > path = /home/$USER/backup > use chroot = no > monge symlinks = no > uid = wendell > gid = wendell > read only = no > list = yes > auth users = wendell > secrets file = /etc/rsyncd.secrets > But rsync doesn't seem to interpret the $USER. I've also tried this > with $HOME and '~' with no luck.Yeah, that's never going to work.> I want to be able to back up to the folder 'backup' that will be in > the users homefolder when a user is backing up remotely to the rsync > daemon.but the user is 'wendell' so put in the path to wendell's home. rsync.conf doesn't support calls out to authentication modules, so there's no way to make this work. If you want each user to be able to access their own backup location, you need a block for each user: [backup-wendell] path = /home/wendell/backup etc.. [backup-wallace] path = /home/wallacebackup etc.. [backup-gromit] path = /home/gromit/backup etc.. -- The Salvation Army Band played and the children drunk lemonade and the morning lasted all day, all day. And through an open window came like Sinatra in a younger day pushing the town away