shell script - Cron job to delete files older than 3 days - Unix ...?

shell script - Cron job to delete files older than 3 days - Unix ...?

WebAug 1, 2024 · 2. To delete the files whose name starts with master-stdout.log and that have not been modified in the last hour, recursively under /root/logs/: LC_ALL=C find /root/logs/ -name 'master-stdout.log*' -mmin +59 -delete. Here using the -mmin and -delete extensions of GNU find, as found on Ubuntu and other GNU-based systems. WebMar 28, 2024 · Remove files via cronjob? Domain Management: 2: Nov 3, 2024: T: Cronjob not delete: Domain Management: 7: Jan 21, 2014: A: Please help me setup a Cronjob to delete files older than 7days old: Domain Management: 14: May 1, 2012: D: How to delete all cronjob of users? Domain Management: 1: Oct 25, 2010: CRONJOB to delete auto … bp m and s near me WebI was setting up a cron job where I wanted to delete log files older than 1 day. The command to do this is as below. I am doing this on a AWS Linux EC2 instance. find /var/log/tomcat8/ -mindepth 1 -mtime +1 -delete. But what I want to achieve is I want to exclude .log files from getting deleted and want to just delete the files with .gz extension. 2844 n broadway st chicago il 60657 WebJan 29, 2024 · Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site WebMar 28, 2024 · Remove files via cronjob? Domain Management: 2: Nov 3, 2024: T: Cronjob not delete: Domain Management: 7: Jan 21, 2014: A: Please help me setup a Cronjob to … bp mangere bridge car wash WebFeb 2, 2024 · We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them. Command Syntax. find /path/to/files* -mtime +5 -exec rm {} \; Note that there are spaces between rm, {}, and \; Explanation. The first argument is the path to the files.

Post Opinion