How to create daily job without write access to /etc?
Solution 1
Unless you're actively blocked from doing cron jobs (i.e., not on /etc/cron.allow
or on /etc/cron.deny
), then you should be able to run your own cron jobs.
Run crontab -e
to open the cron job editor. If it's your first time you'll be asked to select a command line editor. You should probably choose nano
unless you're familiar with one of the other choices.
Cron entries have the format
m h d mon wkday command
So putting in the entry
00 04 * * * bash script.sh
will execute your script at 4:00 am every day.
Save the file and cron will automatically implement it if there are not syntax errors.
See here for more information about cron.
Solution 2
gnome-schedule for automatic tasks.
Gnome-schedule is a graphical user interface and at to manage your crontab file and provide an easy way to schedule tasks on your computer. It supports recurrent (periodical) tasks and tasks that happen only once in the future.
Supports custom titles and icons for your tasks so that they are more easily to keep track of
Templates support so that you won't have to create the same task again and again; these are saved in gconf and may easily ship them with, say, a Linux distribution
If run as root, you can edit any user's crontab and "at" tasks.
Human-readable strings like "Every hour" instead of "0 * * * *"
Advanced mode for crontab experts
Provides a "panel applet" where you can manage tasks from a dropdown menu
Predefined common expressions like: every minute, every week, tomorrow, next week
A calendar allows you to choose the day you want a task executed
UAdapter
Updated on September 18, 2022Comments
-
UAdapter almost 2 years
I don't have write permissions to
/etc
and its sub folders, but even do I would like to have bash script that is executed every morning. How to set it up?also when i type
cron
in command line I getcron: can't open or create /var/run/crond.pid: Permission denied
P.S. This is follow up question to How to append text to file every morning?
P.S.2. Sometimes I don't turn off my computer, so I would rather not use "auto-start"
-
enzotib over 12 yearsI also would to kink to this for common pitfalls: Reasons why crontab does not work
-
UAdapter over 12 yearsit worked, thx!