Running Rhel 7: I've got a script located at /root/backups/backup.py. It backs up my influxdb shards into swift.
It has a shebang in it. When I execute this command in my shell as root:
it runs and functions correctly.
When I tell my cronjob to run it every 5 minutes, it appears as if it is running in the logs:
(root) CMD (/root/backups/backup.py)
However, it looks as if it didn't actually work for some reason. When I check, the backup file in swift that this should have created is not there. It is there when I run it from the shell.
I have no idea what the problem is. I've read many things online about the path in the crontab being incorrect. However, I have other cronjobs running that are in the exact same location i.e. /root/backups/ and they are also python scripts. They run once a minute or once every 5 minutes, and they run correctly. What gives?
我不知道问题是什么。我在线阅读了很多关于crontab中路径不正确的内容。但是，我运行的其他cronjobs位于完全相同的位置，即/ root / backups /，它们也是python脚本。它们每分钟运行一次或每5分钟运行一次，它们运行正常。是什么赋予了？
I don't need any sort of authentication to backup into swift as far as I know. I ssh to the VM, run the command in my console as root without any other authentication, and it works.
Figured it out.
It was having some sort of sudo access authentication error: https://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password