SRCDS Steam group

Cronjobs for Downloads/Log Folders?
Hi Guys,

How can I create a cronjob set to run at oh, let's say about 3:00am every day to clean out the downloads and logs folder. Is this possible? I am not a linux guru so a little help would be great.

I know the command to remove all files from a specific folder:

rm -r *.*

So would the command look something like:

cd /home/path/to/logs/ && rm -r *.*

Just want to make sure I am doing this right. Also is it advised? I run fairly popular servers and those folders fill up quick.
crontab -e
0 3 * * * cd /home/path/to/logs/ && rm -r * 2>&1 >/dev/null

Or make a script using vi like:
# Comments
rm -r /home/path/to/logs/*

and other things you want to add

Close the file then:
chmod +x <filename>

Add that file to the crontab.
In crontab -e

Paste this at the bottem
0 3 * * *  /home/

"Ctrl + x" to leave nano

"y" to save changes to crontab,


"cd /home/"


Paste this in:
rm -f /home/<pathtologfolder/*>

"Ctrl + x" to leave nano

"y" to save changes to

"chmod +x" chmod the file to be executeable

"/etc/init.d/cron restart" To restart the crontab.

I think Toungue

Good luck, Christy.

Forum Jump:

Users browsing this thread: 1 Guest(s)