No, it is not bad to have a long list in crontab
. cron
executes in minutes at the shortest time frame so it is not in real time but you can also have your notices in real time (see below).
As an alternative option you can also use cron
to run 1 script that executes all your different crontab
lines you otherwise would have included in your crontab
where that file is executes or checks all the different options you want to get notices from. That would also be easier to maintain: if you need a new task you add it to your script and you can check if that job is flawed from the script itself (cron can be rather picky).
Might I also suggest you also have a look at creating an upstart
job. This would be more the Ubuntu way. This way you create a daemon
or service
that you can start and stop from command linel. Plus it would make your notices real time instead of periodically.
Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.
# Ubuntu upstart file at /etc/init/yourservice.conf
pre-start script
mkdir -p /var/log/yourcompany/
end script
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - youruser -c "NODE_ENV=test exec /var/www/yourcompany/yourproject/yourservice.js 2>&1" >> /var/log/yourcompany/yourservice.log
end script