Hot answers tagged

4

User crontabs are stored in /var/spool/cron/crontabs/. You can't use the crontab command to see or edit the system crontab /etc/crontab. Note that only the system crontab contains a user field after the date. User crotab entries are always run the corresponding user so they don't need an user field.


4

To set up the cronjob for yr present non-root user, do in terminal: $ crontab -e The above will open yr (non-root) user's crontab with his/her default editor. Alternatively, to do so for the root crontab, but with yr present (presumably non-root) user environment parameters (default editor, etc.): $ sudo -i crontab -e In yr opened crontab, enter a new ...


3

You're right, you can't edit the crontab in Snappy Ubuntu Core. Personally I just create a service that sleeps. For instance, say there was an operation you wanted to run every 15 minutes. Put it in a shell script named my_service.sh: #!/bin/sh while true; do do_my_thing sleep 15m done Make it executable. Now create something like the following ...


2

No, you are using TWO different systems. crontab -u <user> -l will list all jobs added with crontab -e. /etc/crontab is not part of crontab but from another procedure. Both are there for historical compatibility. And the big difference is permissions. User cron jobs will run with the permissions of that user, system cron jobs run with the ...


2

This is normal. When you add lines on the /etc/crontab it's not really attribuate to a profile but the system. If you want to add a crontab to an user: crontab -e -u <user> The users' crontab are stored on the folder /var/spool/cron if you want to see the files.


2

If you look into your ~/.bashrc file youll find the alias which defines alert. # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' Example: Try as input in ...


2

You need to specify what your default output display is. (Sorry, the above reference is in German. I could not find anything else.) A) In the cmd field, introduce: either DISPLAY=:0 /usr/bin/notify-send test or export DISPLAY=:0; /usr/bin/notify-send test and report on result in a comment below if needed. B) You may also try running ...


1

If you don't want to install an MTA (which I currently have no need for) you can pipe the results of the cron job to a log file. sudo crontab -e then with your cron job would look like this. 0 3 * * * /cmd/to/run >> /var/log/somelogfile.log then you can just tail the log and see what happened sudo tail -f -n 50 /var/log/somelogfile.log This is ...


1

You need to capture the elusive crontab output so you can see what it is complaining about. Add -x to your shebang for verbose output in your script: #!/bin/sh -x Set the cron job to execute more frequently while you troubleshoot it: */1 * * * * root /home/absolute/runsikulix -r /home/absolute/auto/test.sikuli Crontab should be logging to ...


1

Try without the && 00 15 * * * export DISPLAY=:0 /path/updater.sh I hope this helps


1

Use a while loop with read to get each IP address and then use ping: #!/bin/bash while IFS= read -r ip; do if ping -q -c2 "$ip" &>/dev/null; then echo "$ip is Pingable" else echo "$i Not Pingable" fi done <"$HOME"/iplist.txt



Only top voted, non community-wiki answers of a minimum length are eligible