Hi,

Nils Breunese (Lemonbit) wrote on 29.10.2007 at 12:59:51 [Re: [BackupPC-users] 
PreUserCmd not working?]:
> Micha Kersloot wrote:
> 
> >I've got a problem with the PreUserCmd command on a archive host.
> >[...]
> >$Conf{ArchivePostUserCmd} = 'touch ~backuppc/ditwaseentest.txt';
> >$Conf{ArchivePreUserCmd} = 'touch ~backuppc/ditiseentest.txt';
> >
> >The thing is that both commands never ran and at the moment i've  
> >got no
> >clue where to start looking.

I'd almost guess they did, in fact, run, only without effect ;-).

> BackupPC doesn't have a shell for *UserCmd, so you have to use full  
> paths (i.e. /bin/touch).

Right, except for the example :). In my experience, Perl exec() actually
does search the path (whatever that is set to, so it's good advice to
explicitly specify what you want as in '/bin/touch'). *But*: you've got no
shell, so ~backuppc is not expanded, resulting in 'touch' trying to touch the
file ditiseentest.txt in a presumably not existing directory with the
strange name ./~backuppc relative to whatever happens to be the working
directory (I wouldn't be surprised if that happened to be ~backuppc (meaning
the backuppc user's home directory), but I haven't checked). Try something
like '/bin/touch /var/lib/backuppc/ditiseentest.txt' or perhaps better
'/bin/touch /tmp/ditiseentest.txt', depending on what you're testing.

While the opposite of the advice ('touch ditiseentest.txt') *might* actually
do what you want in this case, I wouldn't depend on it staying that way. In
particular, the CWD is probably subject to change without notice.

> You could also create a script that does what you want and put the
> location of the script in the *UserCmd variables.

That also makes testing whatever you're doing easier (presuming it's more
complicated than a 'touch'), and you can modify your script without needing
to think about whether you need to restart or reload the BackupPC daemon.

Regards,
Holger

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
BackupPC-users mailing list
[email protected]
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to