You would have to run this as root, but:
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
will loop over each user name listing out their crontab. The crontabs are owned by the respective users so you won't be able to see another user's crontab w/o being them or root.
Edit
if you want to know which user a crontab belongs to, use echo $user
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
I found it easiest to have the exact same configuration as my main site by having a function that created the application shared across all cronjobs and the site.
I did it this way as although there is probably quite a bit more overhead, it didn't matter as much (extra couple of milliseconds on a cronjob are nothing) and as the setup was exactly the same I never ran into any issues using shared code. For example, add database config is in exactly the same place, and if I added another namespace (as you can see I have done), I could do it globally.
The one thing that you could consider doing is using a different bootstrapper, which would reduce the cost as you don't bootstrap the views (which the cron jobs have no need for)
My setup function is (called by cronjobs and the main application):
function createApplication() {
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENV,
CONFIG_PATH . '/application.ini'
);
$application->bootstrap();
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Search_');
return $application;
}
So as mentioned, in my cronjobs, I don't call $application->run()
However, as mentioned, you could use diffrent bootstraps for the cronjobs to avoid setting up the views. Before $application->bootstrap()
is called, you need to call $application->setBootstrap()
/*
* @param $path the path to Bootstrap.php, if not set it will default to the
* application bootstrap
* @return Zend_Application
*/
function createApplication($path = null) {
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENV,
CONFIG_PATH . '/application.ini'
);
if ( $path ){
$application->setBootstrap($path);
}
$application->bootstrap();
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Search_');
return $application;
}
Best Solution
If you're talking about php, you may check first max_execution_time in php, in case the process of sending the list gets over that time, wich may not be very good.