Cronjobは機能しませんが、コマンドは機能します。

Cronjobは機能しませんが、コマンドは機能します。

cronjobリストからコマンドを実行する必要があります。 1つはmysqlバックアップ用、もう1つはディレクトリcpコマンド用です。

コマンドを実行すると動作します。ただし、次のコマンドを実行するとエラーが発生します。

run-parts /etc/cron.daily

間違い:

cp: cannot create regular file 'dpkg.status': Permission denied
touch: cannot touch 'dpkg.status': Permission denied
savelog: could not touch dpkg.status
cp: cannot create regular file 'dpkg.diversions': Permission denied
touch: cannot touch 'dpkg.diversions': Permission denied
savelog: could not touch dpkg.diversions
cp: cannot create regular file 'dpkg.statoverride': Permission denied
touch: cannot touch 'dpkg.statoverride': Permission denied
savelog: could not touch dpkg.statoverride
/etc/cron.daily/logrotate: 6: /etc/cron.daily/logrotate: cannot create status.clean: Permission denied
/etc/cron.daily/logrotate: 7: /etc/cron.daily/logrotate: cannot create status.clean: Permission denied
mv: cannot stat 'status.clean': No such file or directory
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error switching euid to 0 and egid to 108: Operation not permitted
error: error creating output file /var/lib/logrotate/status.tmp: Permission denied
run-parts: /etc/cron.daily/logrotate exited with return code 1
start-stop-daemon: unable to set gid to 12 (Operation not permitted)
run-parts: /etc/cron.daily/man-db exited with return code 2
flock: cannot open lock file /run/mlocate.daily.lock: Permission denied
run-parts: /etc/cron.daily/mlocate exited with return code 66
cp: cannot create regular file 'passwd.bak': Permission denied
cp: cannot create regular file 'group.bak': Permission denied
cp: cannot open '/etc/shadow' for reading: Permission denied
cp: cannot open '/etc/gshadow' for reading: Permission denied
run-parts: /etc/cron.daily/passwd exited with return code 1

私のクローナ:

0 6 * * * zip -rj /home/dan/Dropbox/$(date '+%Y%m%d%H%M%S')_bk.zip /home/dan/dan_portfolio/src/
0 6 * * * mysqldump -u 'danport' -p'I_CHANGE_THIS' danport_db > /home/dan/Dropbox/$(date '+%Y%m%d%H%M%S')_db.sql

答え1

脱出日は私の問題を解決しました。

\%Y\%m\%d\%H\%M\%S

関連情報