I want to centralize a lot of crons to /etc/crontab. Now every user gots it own crons in /var/spool/cron, which is not maintaineble for me. I want to do this automated via a script, but the problem is that the cron syntax differs. In /etc/crontab an user must be stated. How can I get this task done efficiently?
You might start with something like:
It really depends, do you want them to run as the same user they were before?
If my google is correct, the difference in the format is:
Assuming you have the output from users crontabs in a folder, you could do something like:
I don't know if this crontab output makes sense for you, so double check that. It should be possible to make this script even simpler with better perl or using a different tool like awk or sed, but I can't remember the syntax right now.