2
I’m trying to make a task schedule on linux to run a file sh
, does not, however, implement the crontab
, but execute when I do it in hand.
I did a scheduling test to create a text file, it works, but to run the sh
nay.
Follow the settings:
Settings of /etc/crontab:
*/1 * * * * root /home/user/selamat.sh
I’ve tried it like this:
*/1 * * * * root sh /home/user/selamat.sh
And so:
*/1 * * * * root (cd/home/user/ && ./selamat.sh >> Script.log 2>&1)
The shell script settings:
#!/bin/bash
zenity --info --text "SELAMAT";
This script opens a popup.
Does the file have execution permission? If not, give the command chmod +x filename.
– Bruno Rigolon
Already consulted the logs?
– Sidon
There is a chance that zenity is not being found either. It’s usually a good idea to use absolute paths in commands within shell scripts.
– Bruno Coimbra
In some distros, there is an option to put a kind of
cron
per user, with a filecron
somewhere in theHOME
user’s– Jefferson Quesado