Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!
0 Пользователей и 1 Гость просматривают эту тему.
root@ubuntu-home-server:~# crontab -l# /etc/crontab: system-wide crontab# Unlike any other crontab you don't have to run the `crontab'# command to install the new version when you edit this file# and files in /etc/cron.d. These files also have username fields,# that none of the other crontabs do.SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin# m h dom mon dow user command#17 * * * * root cd / && run-parts --report /etc/cron.hourly#25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )#47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )#52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )51 14 * * * root /usr/local/bin/backup.sh
Aug 23 14:51:01 ubuntu-home-server CRON[7925]: (root) CMD (root^I/usr/local/bin/backup.sh)Aug 23 14:51:01 ubuntu-home-server CRON[7924]: (CRON) info (No MTA installed, discarding output)
... >/tmp/script.log 2>&1
Код: [Выделить]... >/tmp/script.log 2>&1
/bin/sh: 1: root: not found
crontab -e
51 14 * * * root /usr/local/bin/backup.sh
Цитата: Aeooe от 23 Августа 2013, 16:03:44/bin/sh: 1: root: not foundПотому что у пользовательского crontab, которыйЦитата: Aeooe от 23 Августа 2013, 14:53:01crontab -eв отличие от системного, немного другой синтаксис.
Да заработало. А почему?...Это ответ на мой вопрос?)
Цитата: Aeooe от 23 Августа 2013, 16:16:56Да заработало. А почему?...Это ответ на мой вопрос?)Да.
Согласно инструкции должен быть указан пользователь...
The format of a cron command is similar to the V7 standard, with a number of upward-compatible extensions. Each line has five time-and-date fields followed by a username (if this is the system crontab file), and followed by a command. Commands are executed by cron(8 ) when the 'minute', 'hour', and 'month of the year' fields match the current time, and at least one of the two 'day' fields ('day of month', or 'day of week') match the current time (see "Note" below).
Страница сгенерирована за 0.021 секунд. Запросов: 22.