Elyad Alaei
2014-Nov-12 10:53 UTC
[Samba] backup script exit with error (probably because of tar warning)
Hi dear list members It's some time that we have issue regarding backup script of samba 4.0.10. It exits with error: "Error while archiving /home/a/samba-backup/samba4_private.121114.tar.bz2" After some troubleshooting, I noticed it is PROBABLY because of tar, issuing this warning with the exit code of 1: "tar: ./private: file changed as we read it" It is related to this line in the backup script: tar cjf ${WHERE}/samba4_${n}.${WHEN}.tar.bz2 $relativedirname --exclude=*.ldb >/ dev/null 2>&1 if [ $? -ne 0 ]; then echo "Error while archiving MYpri ${WHERE}/samba4_${n}.${WHEN}.tar.bz2" exit 1 fi I'm afraid, changing the exit condition, inorder to exclude exit code with 1, would result in unsafe backups? Any ideas? Tanx E. Alaei
Sven Schwedas
2014-Nov-12 11:12 UTC
[Samba] backup script exit with error (probably because of tar warning)
On 2014-11-12 11:53, Elyad Alaei wrote:> I'm afraid, changing the exit condition, inorder to exclude exit code with > 1, would result in unsafe backups?The exit code is documented as:> 1 Some files differ. If tar was invoked with the > --compare (--diff, -d) command line option, this > means that some files in the archive differ from > their disk counterparts. If tar was given one of > the --create, --append or --update options, this > exit code means that some files were changed > while being archived and so the resulting archive > does not contain the exact copy of the file set.So yes, the cause are changes to the databases while you archive them. I'm not sure whether the script is supposed to be run while samba itself is running, tar cannot backup open tdb/ldb files. -- Mit freundlichen Gr??en, / Best Regards, Sven Schwedas Systemadministrator TAO Beratungs- und Management GmbH | Lendplatz 45 | A - 8020 Graz Mail/XMPP: sven.schwedas at tao.at | +43 (0)680 301 7167 http://software.tao.at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 648 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20141112/a6886ea4/attachment.pgp>