Well, I'm not experienced in BASH/PERL programming, sometimes I make some changes in the backup script. It compresses the data on a tape drive, check is everything done ok and sends a report via email. As it was earlier:
Code:
$exit_code=system("$tar czvf $tapedevice $oracle 1>$tar_status 2>$tar_errors");
and then
Code:
if ((stat($tar_errors))[7] && $exit_code)
checks wheater all is ok or not, click link to see all the code
Perl pastebin - collaborative debugging tool
Lately I added encryption for some more security
Code:
$exit_code=system("tar czvpf $tapedevice $oracle $samba $config $src $webdav | openssl enc -aes-256-cbc -salt -pass file:/tmp/.key 1>$tar_status2 2>$tar_errors2");
copy works, encryption too, but the report always says it's ok, even when it's not
Does anyone know how to check exit code so it would work with tar | openssl.
This is the full script (the part doing compression and encryption):
Perl pastebin - collaborative debugging tool