Link to home
Start Free TrialLog in
Avatar of jjcheap1
jjcheap1

asked on

House Keeping Script

Hi,

I need a script to go through /home/ALL THE USERS/public_html/ftpbackup and delete all files that are 2 weeks or older.  Then I will make this script a cron job.

ALL THE USERS are users home directories.

Thanks
Scott

ASKER CERTIFIED SOLUTION
Avatar of unSpawn
unSpawn
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
// Note  the "&& echo "${args}"" bit should be changed to read " && rm -f "${args}"" if you're satisfied it works.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jjcheap1
jjcheap1

ASKER

Thanks,

The script runs through about 30 users and throws out this

./xx.sh: line 3: syntax error near unexpected token `|'
./xx.sh: line 3: `| while read dir; do find "${dir}" -type f -printf '

Any suggestions?

Thanks
Scott
most likely \ is not  the last character in line 2