Cron Job to delete file every 30 days - Server Fault?

Cron Job to delete file every 30 days - Server Fault?

WebJan 29, 2024 · 1 In Ubuntu 17.10 the command find /Home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f -delete>$ delete my files older than 1 day. But I have no result in combination with a cron. Could you please inform me about my mistake in the line below? My command is: 15 00 * * * find /home/khemtit/Documents/Tijdelijk/ -mtime +1 -type f … WebGo to folder cd /etc/cron.d to create cron jobs that will be run every day. Create a file and write the desired cron sentence. At 1 o'clock AM every day remove from /var/log/*.log files that are at least 7 days old. 0 1 * * * root find /var/log/*.log -mtime +7 delete \; At 3 o'clock AM every day move from /var/log/*.log files to /var/log/history boxabl house reviews WebWhen running it as a cron job with exactly the same command however, an empty gzip file appears with nothing in it. The cron log shows no error, just that the command has been run. This is the script: WebIf you just need to remove the old server.log and console.log every month you can also use logrotate which is most likely already running under RHEL. A config snippet like this will work in /etc/logrotate.d/*.conf or wherever the config files are located on your system. 24 rue thomas couture senlis WebSep 28, 2015 · To cleanup you'd want to run find $ {REPORT_ROOT} -type f -mtime +2 -delete provided that there is no parent directory created for each separate report. This can be run in a separate job or as subproject to the job that publishes html report or in the job itself. -mtime +2 means older than 2 days. WebDec 21, 2024 · You could obviously also schedule the find command directly with cron: 0 0 * * * find path -type f -mtime +0 -print -delete >/path/auto_delete_backup_database.log 2>&1 I think this is … boxabl house size WebTìm kiếm các công việc liên quan đến Powershell script to delete files older than 30 days hoặc thuê người trên thị trường việc làm freelance lớn nhất thế giới với hơn 22 triệu công việc. Miễn phí khi đăng ký và chào giá cho công việc.

Post Opinion