I'm working on ultimate backup script for very important server. My script already:
- creates a backup
- verifies copied file(-s)
- verifies gz archive
- compares MD5 on local and remote after sending file to remote server via scp
- removes monthly backups older than 365, weekly backups older than 31 days, daily backups older than 7 days, hourly backups older than 24 hours
- checks for available disk space on local and remote machine
- sends email report if some errors ocurred
- sends email report for weekly backups
In addition to all this, I miss one important thing - clock verification on local and remote because it affects the naming and removal of copies.
How can I make sure if date and time are set correctly in bash in a simple and reliable way?
If possible - it would be nice if that method could work on Windows server with cygwin.
I'm not asking for complete solution, just advice for taking correct and not complex approach.