MyBB Community Forums

Full Version: Script to Delete Files every 24 hours
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2010-04-15, 06:12 AM)TimB. Wrote: [ -> ]If your using cPanel just set up a cron job with the following command to run every 24h:
php /home/yourusername/taskfilename.php

Where yourusername is your cPanel username and taskfilename is the name of your PHP file, put it in the highest directory of your account, above publick_html

Publick?
So, could I simply get away with doing this?

[Image: screenshot20100415at7.png]
don't use the -rf (it recursively removes all subfolders as well)

rm /path/to/folder/*.png would delete all png files in folder
(2010-04-15, 11:15 PM)Lee Merriman Wrote: [ -> ]Publick?

My bad, fixed Toungue
Is this better?
[Image: screenshot20100416at6.png]
(2010-04-16, 10:04 AM)frostschutz Wrote: [ -> ]don't use the -rf (it recursively removes all subfolders as well)

rm /path/to/folder/*.png would delete all png files in folder

He wants to recursively remove all the folders.
(2010-04-15, 03:43 AM)Chasingu Wrote: [ -> ]Ok, I have a new request.

I want the script to delete .png files every 24 hours in a certain folder.
Wink
Pages: 1 2