1.

Solve : Linux sh Script for files older than?

Answer»

I have a backup of mysql databases and backup file is with time and date in name, like this
daily_amavisd_2016-10-01_05h28m_Saturday.sql.gz
daily_amavisd_2016-10-02_05h28m_Sunday.sql.gz
daily_amavisd_2016-10-03_05h28m_Monday.sql.gz

So I NEED a SCRIPT to check if the OLDEST file in folder /backup/amavisd/daily is not older than one week. If it is older than one week it gives me status "backup FAILED" if it is not older than 1 week than gives me status "backup OK"

Can someone help me with sh script for that?



Discussion

No Comment Found