Hi,
Little annoying problem with errors en rsnapshot (log) verbosity.
I usually put verbose level on 2, and the loglevel on 3.
That way, I get emails only when an error occurs, and when neccessary I can check the log file for extra info.
For performing backups of some databases, I have a simple script that remotely logs in through SSH and dumps the said databases
(http://support.ginsys.be/wsvn/scripts/backupdump/backup_hostdb.sh if you're interested).
Note that I run that script one time per remote host, with the remote host as a parameter. So if I can see which instance of the script was called, I can know on which host it ran.
On one host, the mysqldump part of the script generates an error, which point to a problem on the mysql setup (corrupt tables).
That error is the only piece of text that is being sent to STDOUT, and hence gets mailed through cron. Having only that error text, I can't know at what point rsnapshot launched the backup script, and hence I can't figure out which host experiences this problem.
So far so good, that's logical given the "verbose 2" level. My problem now arises when looking into the log file, hoping to find that same error, and seeing the context to know on which host it happens. But I can't find anny report or mention of an error.
I tried putting using "loglevel 4" but all I get is something like
[12/Mar/2010:00:24:08] mkdir -m 0755 -p /srv/rsnap/shots/tmp/
[12/Mar/2010:00:24:08] cd /srv/rsnap/shots/tmp/
[12/Mar/2010:00:24:08] /usr/local/bin/backup_hostdb.sh -h rsnapshot < at > ilabolamptest.ibbt.be ([email]rsnapshot < at > ilabolamptest.ibbt.be[/email]) -d -m
[12/Mar/2010:00:24:11] cd /root/
[12/Mar/2010:00:24:11] sync_if_different("/srv/rsnap/shots/tmp/", "/srv/rsnap/shots/hourly.0/DUMPS/ilabolamptest/")
[12/Mar/2010:00:24:12] /bin/rm -rf /srv/rsnap/shots/tmp/
doing a
grep -A1 backup_hostdb /var/log/rsnapshot
gives me the same'ish output for all called instances.
So the mysql error does not get back to the rsnapshot log.
rsnapshot doesn't even seem to detect an error state, but I guess that's normal, as I don't do proper error code handling in my script.
Could it be that rsnapshot doesn't pick up the script output (STDOUT and? STDERR) to be able to log it?
Any help on how to improve my script or my rsnapshot config is kindly appreciated.
--
Met vriendelijke groet,
Serge van Ginderachter
