I am looking to have a script delete files that are older than 90 days in certain directories. As in, there are 8 directories that have different paths to them.
I can run the find command on one directory as such:
find /directory1/dir2/dir3/dir4/ -mtime +90 | wc -l
That command will give a result like 6401.
But I have 8 directories that need to be looked through. How could I build a list of directories as a variable. I have:
variable DIRLIST=/directory1/dir2/dir3/dir4/ /directory1/dir2/dir3/dir5/ /directory1/dir2/dir3/dir6/ /directory1/dir2/dir3/dir6/ /directory1/dir2/dir3/dir7/ command find $DIRLIST | wc -l
The output gives me something along the lines of:
nameofscript.sh: /directory1/dir2/dir3/dir5/: 0403-006 Execute permission denied.
Its strange because when I call that directory alone in the find command, the command works, so I know its not actually a permissions issue.
Any help would be greatly appreciated.