【发布时间】:2015-12-23 11:13:18
【问题描述】:
我正在尝试设置 rethinkdb 的定期备份,但一直遇到问题。你如何设置 rethinkdb-dump 从 cron 运行?
这是我的脚本:
$ cat backup.sh
#!/bin/bash
NOW=$(date +"%Y-%m-%d-%H-%M")
/usr/bin/rethinkdb dump -e my_db -f /root/db_backup/$NOW.tar.gz
当我手动运行脚本时,它运行得很好。但是,当尝试从 cron 运行它时它不起作用,我在stderr 得到以下信息:
Error when launching 'rethinkdb-dump': No such file or directory
The rethinkdb-dump command depends on the RethinkDB Python driver, which must be installed.
If the Python driver is already installed, make sure that the PATH environment variable
includes the location of the backup scripts, and that the current user has permission to
access and run the scripts.
Instructions for installing the RethinkDB Python driver are available here:
http://www.rethinkdb.com/docs/install-drivers/python/
这似乎是 Python 环境问题,但我无法弄清楚如何让它快乐......想法?救命!
【问题讨论】:
标签: python bash cron rethinkdb