I am trying to make a checkpoint management script, which will delete all checkpoints that are over 3 days old for a variety of databases. I want to keep the code in one script and then keep a list of all the paths to each database I want to manage in another.
How do I reference the file with the list of databases, so I can use them in a for loop? In the loop, how do I change directories to each directory listed in the text file?
Ex. File with list of databases (db.list):
/directory/directory/databse1
/directory/directory/databse4
/directory/directory/databse10
Ex. Code:
for database in db.list
do
cd $database
code
done