Okay so some of you may have realised that i am creating a small backup script, now i have another question.
Lets say that the file backup_log.txt will be within the directory where files are backed up to.
So for example i have run my script and it has backed up to
so within that folder there is a file named backup_log.txt
Now my problem is, lets assume i am backing up the current directory, and this directory contains a previous backup folder.
So i am backing up my home directory:
and inside i have
I have a sort of recursive script to go through and backup files, and i created a simple case to check whether the folder name was .backup
case $(dirname $filestoback) in
*/.backup*) echo "is backup folder"
However what i would really like to do, is exclude the folder, only if it contains the backup_log.txt file inside it, because theoretically, the backup folder could have a different name!
Thank you very much.