Periodic Script- Daemon-
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 scr开发者_JAVA技巧ipt 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.
you need to set up a cron job.
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).
精彩评论