Reputation: 7028
I want to setup crontab to run same jobs for every user on linux, is there any way just to specify the job and it will run for every user ?
Thanks
Upvotes: 0
Views: 2183
Reputation: 41
Any user can execute "crontab -e" (without sudo) and put your commands, obviously the user must have permissions to execute commands.
Upvotes: 1
Reputation: 475
One option is to add your scripts to root/system crontab like,
either copy your scripts to
/etc/cron.daily/
/etc/cron.hourly/
/etc/cron.monthly/
/etc/cron.weekly/
or
sudo crontab -e
and then add new entry for your script.
And the problem with this option is all commands in script run with administrative privileges (i.e. they are generally run using sudo).
Upvotes: 1
Reputation: 12481
I believe /etc/crontab
is global, you can add jobs to run for all users to that file.
What I am unsure about is whether you need to restart the cron
service for the changes to take affect
Upvotes: 0