Forum Moderators: coopster & phranque

Message Too Old, No Replies

Obliterated by a cron

         

BoneHeadicus

4:48 pm on Mar 20, 2001 (gmt 0)

10+ Year Member



If'n I wanted to DELETE the contents of a folder once a month how would I write the cron file?

* * * * * /home/sites/site100/web/log/??????

???

sugarkane

10:28 am on Mar 22, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BH - I'm not sure you're understanding cron correctly. You need to write a script that deletes the contents of the folder in question eg:

#!/bin/bash
rm -f /home/sites/site100/web/log/*
exit

and then set up a cron as per Air's walkthrough here [webmasterworld.com]

The crontab file does nothing of itself, it simply calls an external program at a specified time.

BoneHeadicus

4:08 pm on Mar 22, 2001 (gmt 0)

10+ Year Member



Well I do understand crons' purpose but I don't know how to write Penquin(*nix) yet. I can understand the bork, bork, bork translation pretty good at Google though.

That rm command is pretty handy when you know what it does. I probably need some linquistic lessons and basic commands. I haven't found a Linux book yet that has helped me.

Thanks sugarkane

DaveAtIFG

5:42 pm on Mar 22, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BH - Take a look here [cc.uoregon.edu] for a quick and dirty reference to the basics.