szone What cron job will help to delete files from a specific folder after 1 hour of that file creation? Using CentOS 7. Images are being uploaded by users and they must be deleted after 1 hour from the server to save storage disk space.
dasklney Go to Cron page and create new Shell Script cron job. Script content: rm -rf /var/www/foldertodelete Replace: /var/www/foldertodelete with the directory you want to delete.
szone dasklney Thanks, but it will only remove the folder after each 60 min. I want to remove files which are older than 60 mins only.
szone aapanel_user Thank you. I want to remove the files inside the folder, not the folder itself, this command will work for that purpose? Looking forward to have your valuable response.