Przeczytałem, że ma być plik w /etc - cron.allow, nie miałem go, więc utworzyłem jako root i wpisałem nazwę użytkownika i dalej nic. Ma ktoś jakiś pomysł?
[quote="""] crontab is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. If the /etc/cron.allow file exists, then you must be listed (one user per line) therein in order to be allowed to use this command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/cron.deny file in order to use this command. If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this com- mand, or all users will be able to use this command. If both files exist then /etc/cron.allow takes precedence. Which means that /etc/cron.deny is not considered and your user must be listed in /etc/cron.allow in order to be able to use the crontab. Regardless of the existance of any of these files, the root administrative user is always allowed to setup a crontab. For standard Debian systems, all users may use this command.[/quote]
Jak wynika z ostatniego zdania po standardowej instalacji Debiana każdy użytkownik domyślnie może mieć swojego crona. Wskazówka: usuń /etc/cron.allow i /etc/cron.deny i spróbuj utworzyć zadanie cron. Jak nie pójdzie to zweryfikuj jeszcze uprawnienia do katalogu /var/spool/cron/crontabs powinien mieć uprawnienie write dla groupy crontab jeśli ma to jeszcze sprawdź uprawnienia do /usr/bin/crontab powinien mieć mieć ustawiony bit SUID dla grupy crontab, czyli powinien mieć uprawnienia (2755/-rwxr-sr-x)
Ostatnio zmieniony 25 maja 2016, 15:14 przez franek4always, łącznie zmieniany 1 raz.
Udało mi się, skorzystałem z edytora mc i poprawnie dodało mi wpis. Nie wiem dlaczego, kiedyś korzystałem z nano i wszystko było w porządku. Mam natomiast inny bardzo dziwny problem. Dodaję wpisy do crontaba i się nie wykonują. Dodaję poprawnie wpisy, jednak się nie wykonują i nie mam zielonego pojęcia dlaczego. Oto moja tablica:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
38 15 * * * /home/debian/Desktop/test.sh
#
Bo normalnie z crona nie można uruchamiać aplikacji graficznych, a w skrypcie odpalasz icedove'a (crond nie wie na którym ekranie ją uruchomić, bo i skąd). Trzeba go poinformować o tym ustawiając odpowiednio zmienną DISPLAY. Przykładowy wpis może wyglądać tak:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
*/1 * * * * export DISPLAY=:0 && /usr/bin/icedove