[GRLUG] using flock

Dave Chiodo megadave at gmail.com
Tue Dec 24 12:30:56 EST 2013


Might I humbly suggest - have the mysqldump output to a file with a
timestamp instead of overwriting the old one.

Eg sysmysqldump-2013-12-24:12:00.sql. (using the current date).

The have another script going back and removing older dumps (up to you how
many to retain)


On Tue, Dec 24, 2013 at 9:17 AM, Eric Beversluis <
ebever at researchintegration.org> wrote:

> I've got a backup program on a server that includes a mysqldump once a
> day which overwrites the existing sysmyqldump.sql. The script also does
> rsync (of zarafa-backup, the mysqldump, and /var/lib/zarafa (the zarafa
> attachments file) to an external hard drive. Once a month is also copies
> the sysmysqldump.sql that's on the external HDD to a file with that
> day's date attached.
>
> The cron is set to run every hour. Right now, mysqldump is finishing at
> 40 min past the hour (00:40), so I think that when it also tries to make
> the copy on the 1st of the month it will run over into the next hour.
>
> As I understand it, the thing to do to prevent the script starting over
> before the old one finishes is to use 'flock.'
>
> My question is this: How does cron respond if flock prevents the script
> from starting at 01:00? Does it start it when the flock is freed or just
> skip that cycle or what?
>
> Thanks.
>
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shinobu.grlug.org/pipermail/grlug/attachments/20131224/e272a000/attachment-0001.html>


More information about the grlug mailing list