Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing snapshots from the snapshot script #2

Open
bmccarthy321 opened this issue Jun 28, 2018 · 0 comments
Open

Missing snapshots from the snapshot script #2

bmccarthy321 opened this issue Jun 28, 2018 · 0 comments

Comments

@bmccarthy321
Copy link

Thanks for doing all the hard work on this one and posting it for all, it is very much appreciated.

First, I threw a simple pid file check in the script at the beginning for anyone who wants to use it. If the backup/send takes too long and the script runs again, it will cause issues. This is especially true on the first send when it does a full send.
PIDFILE=/var/run/zincrsend.pid
if [ -e $PIDFILE ]; then
echo "Zincrsend Already Running"
exit 1
fi
echo $$ > $PIDFILE

Then just an rm $PIDFILE at the end of the program. It's simple, but it got me when I was still doing a first send, and then my cron tried to start it again. It made a bit of a mess.

Second, I was using your snapshot-all program to give myself some weekly, monthly, and daily snapshots, and then ran the zincrsend every 4 hours to minimize the amount of time it takes to send. The issue is that the zincrsend script checks if the last backup exists, and sends the next one... but if the auto snapshot script makes another backup in the mean time, zincrsend doesn't know this... it only looks for the last one on the remote fs.

I'm thinking the best way to do this is to take the line that opens the remote fs and grep/sort/tails the name of the snapshots, and rather than just look at the last one, to recurse the entire list and compare all the snapshot on remote vs local. I'm going to attempt to do that, if someone else has a better idea throw it out there. Alternatively I was considering making the "snapshot_prefix" a command line argument and not using the auto snapshot at all... just run zincrsend for daily, weekly, monthly, and hourly. Not sure if that will work yet, haven't tried it.

Recursing through could also be a way to add the zfsstreamdump in that process to verify they're all still intact, though I'm not sure about that part yet... don't know if it'll take too much time or not.

Anyway, I'm going to continue playing, if others happen to notice things or have comments/suggestions, I'm all ears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant