Отредактировано
Почему приведенная ниже команда вызывает crontab -e
показать ошибки отказа в разрешении?
/bin/sh /var/www/ers-api-proxy/backup.sh 1> /var/www/ers-api-proxy/log.txt 2> /var/www/ers-api-proxy/err.txt
Crontab у меня отлично работает, пока я не запустил эту команду.
Когда он перестал работать изначально, я восстановил свою каплю DO, и он снова начал работать. Затем, когда я выполнил указанную выше команду во второй раз, та же проблема возникла снова?
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# EDITOR=pico
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# crontab -e
pico: Permission denied
crontab: "pico" exited with status 1
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# export EDITOR
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# crontab -e
pico: Permission denied
crontab: "pico" exited with status 1
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# sudo crontab -e
/usr/bin/sensible-editor: Permission denied
crontab: "/usr/bin/sensible-editor" exited with status 1
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# export EDITOR=/usr/bin/sensible-editor
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# sudo crontab -e
/usr/bin/sensible-editor: Permission denied
crontab: "/usr/bin/sensible-editor" exited with status 1
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy# crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
0 5 * * 2 /bin/sh /var/www/ers-api-proxy/backup.sh 1> /var/www/ers-api-proxy/log.txt 2> /var/www/ers-api-proxy/err.txt
root@ubuntu-s-1vcpu-1gb-sfo2-01:/var/www/ers-api-proxy#
редактировать: Кстати, я только что повторно вошел в SSH и тоже получаю эту ошибку, которая, как мне кажется, раньше не отображалась (но не на 100%).
-bash: /usr/bin/lesspipe: /bin/sh: bad interpreter: Permission denied
/bin/sh
также то, что я добавил в свой cronjob, может ли это быть связано?
Редактировать 2: На самом деле похоже, что это несколько команд, которые больше не работают для меня, хотя я вошел в систему как root. Вот что происходит, когда я пытаюсь запустить свой сценарий оболочки сейчас (который раньше работал нормально)
tar (child): gzip: Cannot exec: Permission denied
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now