BackupPC-users

Re: [BackupPC-users] Sending output of DumpPreUserCmd by email

2017-05-18 11:31:23
Subject: Re: [BackupPC-users] Sending output of DumpPreUserCmd by email
From: Richard Shaw <hobbes1069 AT gmail DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 18 May 2017 10:30:50 -0500
On Thu, May 18, 2017 at 9:49 AM, Vladislav Kurz <vladislav.kurz AT webstep DOT net> wrote:
Hello all,

First of all big thanks to all developers of BackupPC, it is really a
very nice and useful backup tool.

I use DumpPreUserCmd (and similar options) to run mysqldump, or make
snapshots of filesystems before backup. I would like to have the output
of these mailed to me instead of being just logged.

Probably not the direction you were thinking but why not create a systemd service file for DumpPreUserCmd to start?

I'm assuming you're using a system which uses systemd...

If you prepend the command in the service file with a hyphen the unit will exit cleanly even if the command failed...

ExecStart=-/command/to/run

Then you would set your DumpPreUserCmd to "/usr/bin/systemctl start <unit>" 

You would want to set the unit type to "oneshot" so it doesn't return until the command is finished.

Just a thought.

Thanks,
Richard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
<Prev in Thread] Current Thread [Next in Thread>

ADSM.ORG Privacy and Data Security by KimLaw, PLLC