Once confirmed, you are good to go to delete those files with the following command. Verify the file list and make sure no useful file is listed in the above command. If you just have xargs, then pipe to xargs (adding -no-run-if-empty if the GNU extensions are available). what i want to do is some sort of cron job comand or tiney php or cgi script that deletes file if it is older than 30 days in sepecific folders. First of all, list all files older than 30 days under /opt/backup directory. If you have -delete, that’s the definite high-performing version. I don’t think it was present in 4.4BSD, nor is it present in Posix. Of course you can use rm command: find /home/incoming/images/ -type f -iname '*.jpg' -mtime +30 -exec rm should still be considered relatively expensive, and I wouldn’t use it unless with a simple command like rm, but there might be other instances where you want to do something complicated there. Purge bibliographic records deleted more than DAYS days ago from tables. I’m new to cron, so I’d really appreciate someone pointing out where I’ve gone wrong, or how to diagnose it if not obvious. I can see the job is running, but the files still exist in the folder. txt files in a folder that are older than 7 days. Just use find with -mtime option: CentOS Linux: Delete All *.png Files Older Than 30 Days find /home/incoming/images/ -type f -iname '*.png' -mtime +30 -delete Scripts executed as a cron job are typically used to modify files or databases. Can a cron job delete all.txt files I have a cron job that runs at midnight to delete all.
0 Comments
Leave a Reply. |