|
|
Question : perl daemon
|
|
How do you write an automatic process (i.e. once a day daemon) which will read the timestamp on each entry line in a text file and delete the entries which have expired?
|
Answer : perl daemon
|
|
Assuming you are on UNIX, I would use a cron job rather than a daemon.
1. Schedule a cron job to run once per day. You will need to create an entry in your /etc/crontab table.
2. The entry will simply be the command to invoke your perl script that reads the time stamps from your text file and deletes expired entries.
3. Becuase cron jobs normally run as super user, you may need to specify the full path to both perl and your script. For example:
/usr/local/bin/perl /path/to/your/script.pl &
|
|
|
|
|