0

ux and i need delete a specific file every day. then I need to do a shell script or something else with a simple command for example

# rm <filename>

But i need add this script to init, or convert this script in daemon TO GRANT that every day at 20:00, this script run and delete the file.

I guess that the above is the procedure, but I can be wrong. Can you please guide me in this situation. Thanks a lot.

MaK
  • 83
  • 1
  • 2
  • 11

2 Answers2

1

you need to set up a cron job.

ghostdog74
  • 327,991
  • 56
  • 259
  • 343
  • thanks for info and guide. Tomorrow, I will see this command. Another question.. This crontab run after I restart the server for example or I close the session, or I need consider other things..? – MaK Jul 29 '10 at 00:50
  • yes, cron daemon runs at startup, unless you specifically disable it – ghostdog74 Jul 29 '10 at 02:21
1

You are looking for man crontab.

The crontab line you are looking for will look like this:

0 20 * * * rm <filename>

You would put this line as an entry in the crontab of the user it needs to run as (e.g. root).

Slartibartfast
  • 1,694
  • 9
  • 8