I want to set a personal crontab in another folder and executed.
For example I want it in /home/project/tasks/crontab
Like that it's easier to add/delete tasks.
Thank you for your answers.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
cron daemon determines where your active crontab is stored. On my system (Ubuntu), and probably on yours, it's under
But you can maintain your crontab entries anywhere you like. Just remember to run
every time you update it.
(I suppose you could set up a cron job to do that for you. Disclaimer: I haven't actually tried invoking
crontab from a cron job; I'm not 100% sure it would work.)
I personally find that a lot easier to manage than using, say,
crontab -e; I can maintain my crontab file under a source control system, so I don't lose anything if I accidentally do
crontab -r, for example.
I suppose you could set up a cron job to do that for you. Just as an experiment, I tried setting up a crontab with the following command:
* * * * * crontab .crontab
After manually running
crontab .crontab once, changes in
$HOME/.crontab were automatically applied after I saved the file, taking effect one to two minutes later.
But personally I'd much rather just run
crontab FILENAME manually, so I don't have to worry about what will happen if I save an intermediate version of the file.