johnnyasterisk
IS-IT--Management
I have a directory with over 200,000 files in it but some file are old. I also have a table in mysql which keeps a record of every file in that directory:
Example:
DIR = Recordings
FILE = 1234567.gsm
I can run a query on my table to fine specific files and dump that into a text file. For example I might want to find all files put in this directory by john and get a txt file in the following format:
12344.gsm
12466.gsm
15234.gsm
(Above is as much as I can do what I need help on is below)
I now have a file called john.txt with 300 lines in it each line looking like this:
12344.gsm (but different numbers)
These are the file names of all files put in this directory by john and I want to remove them if they are older than 6 months.
I need help writing a shell script that will:
* read the txt file
* One line at a time check if the file is older than 6 months and if so delete it
Example:
DIR = Recordings
FILE = 1234567.gsm
I can run a query on my table to fine specific files and dump that into a text file. For example I might want to find all files put in this directory by john and get a txt file in the following format:
12344.gsm
12466.gsm
15234.gsm
(Above is as much as I can do what I need help on is below)
I now have a file called john.txt with 300 lines in it each line looking like this:
12344.gsm (but different numbers)
These are the file names of all files put in this directory by john and I want to remove them if they are older than 6 months.
I need help writing a shell script that will:
* read the txt file
* One line at a time check if the file is older than 6 months and if so delete it