How to create daily job without write access to /etc?

5,470

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 Install 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

enter image description here

Share:
5,470
UAdapter
Author by

UAdapter

Updated on September 18, 2022

Comments

  • UAdapter
    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 get

    cron: 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
    enzotib over 12 years
    I also would to kink to this for common pitfalls: Reasons why crontab does not work
  • UAdapter
    UAdapter over 12 years
    it worked, thx!