PDA

View Full Version : Cron job help - overwriting a file every 3 hours


AshleyQuick
10-24-2004, 04:30 PM
I have a small txt file entitled \edit\news.txt How is it possible, using a cron job, to overwrite this file with \edit\cron\news.txt every 3 hours?

\edit\news.txt is a dynamic file that contains content that is displayed for a news publisher script demo. I want my site's users to be able to use the demo in a normal fashion but, as you can imagine, every now and then someone will post unsavory content :) Consequently, I thought this would be an efficient, and automatic, solution to overwrite the dynamic txt file with my default txt file that I will place in the cron folder.

Attached is a screenshot of the cron manager interface that is available to me via my web host.

Thanks,

Ashley

AshleyQuick
10-25-2004, 05:56 PM
05 0,3,6,9,12,15,18,21 * * * cp /edit/cron/news.txt /edit/news.txt


That will copy the file /edit/cron/news.txt to /edit/news.txt at 0005, 0305, 0605, 0905, 1205, 1505, 1805, and 2105 everyday...