Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to create a package, which should add itself to list of cron jobs, and remove it from that list on deinstallation.

How can I do it without possibility of screwing the crontab file? Maybe there are some utils?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Instead of adding your lines to a crontab, you should just place a file inside /etc/cron.d/. See https://help.ubuntu.com/community/CronHowto#Advanced_Crontab:

The second type of crontab is to be found in /etc/cron.d. Within the directory are small named crontabs. The directory is often used by packages, and the small crontabs allows a user to be associated with the commands in them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.