1. Create a Cron Job
To create a cron job, in terminal, type
crontab -e to edit the cron job. Review following examples :
1.1 Run daily at 00:00, accepts two parameters.
# run everyday 0 0 * * * java -jar /home/mkyong/crawler/webcrawler.jar param1 param2
1.2 Run daily at 02:00 am, pass
rir.name as a system property with
# run everyday at 2am 0 2 * * * java -jar -Drir.name="ripe" /home/mkyong/crawler/whoiscrawler.jar
1.3 Run hourly, assume this jar is logging message with the logback framework.
# run every hour 0 * * * * java -jar -Dlogback.configurationFile=/home/mkyong/logback.xml /home/mkyong/crawler/crawler.jar