views:

16

answers:

2

Hi i have hp-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.

+1  A: 

you need to set up a cron job.

ghostdog74
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
yes, cron daemon runs at startup, unless you specifically disable it
ghostdog74
+1  A: 

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