Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Linux sh Script for files older than  (Read 5635 times)

0 Members and 1 Guest are viewing this topic.

Blisk

    Topic Starter


    Intermediate

    Thanked: 1
    • Experience: Familiar
    • OS: Windows 7
    Linux sh Script for files older than
    « on: October 07, 2016, 06:20:34 AM »
    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?