Cron bash script virtnbdbackup | mail only if error? #171
Replies: 5 comments
-
you can disable progressbar with --noprogress or use --quiet, it disables logging output but will exit with error code accordingly, as such you can script around to send logfile if backup fails. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the hint, --noprogress make sense. --quiet is much so quiet for me, I like to see some details* for example:
*This is more an enhancement, I know. |
Beta Was this translation helpful? Give feedback.
-
I just getting started but I am running via crontab and have it setup to email on errors. Here are the relevant lines. Amateur work, but it's working fine: errstate="false" virtnbdbackup -d Gibson -l auto -o $bakdir &>> $templog cat $templog >> $adminlog if error say soif $errstate = "true"; then mail error to sendtoif $errstate = "true"; then -- |
Beta Was this translation helpful? Give feedback.
-
You might want to take a look at Cronic I worked with it for some other projects. Cronic only sends emails, when the internal script writes to stderr or when exitcode != 0. |
Beta Was this translation helpful? Give feedback.
-
Send a mail only if there is an error is not enough, I need the following information: At the moment I received a email every night from the cron job. Or do someone has an better idea? |
Beta Was this translation helpful? Give feedback.
-
Hi,
do anyone use virtnbdbackup with a cronjob?
I start virtnbdbackup in my bash script, but every start produce a long and "unreadable" cron mail:
Version 2.4 with info log level, I need only a mail from cron if something is wrong/failed.
Or some short overview, backup type (full,inc,...) and amount of data in the backup...
Beta Was this translation helpful? Give feedback.
All reactions