- python /my_django_project_path/manage.py database_bu, , cron environment , cron, script ( ).
-, script
47 16 * * * root python/my_django_project_path/manage.py database_bu
root, , , . , root sudo su, , root . FWIW, - root , .
, cron .
47 16 * * * cd /my_django_project_path/ && python manage.py database_bu
cron. 2- : , cron, .netrc , , .
, , PATH , echo $PATH , /some/path:/some/other/path:/more/path/values, cron,
47 16 * * * export PATH="/some/path:/some/other/path:/more/path/values" && cd /my_django_project_path/ && python manage.py database_bu
, .
printenv > ~/environment.txt , , . cron * * * * * printenv > ~/cron_environment.txt, cron. , script, script
import os
os.system("printenv")
, , (, HOME), script/cron, , .
, , bitbucket .netrc, . .netrc cron.
ssh keypair ssh https ( , ssh- , ssh-keys.
, ssh, , , url .git/config ( origin_ssh git remote add origin_ssh url ssh).
, https URL- https://user@bitbucket.org/user/repo.git, ssh - git@bitbucket.org:user/repo.git.
PS: bitbucket, , , git , , . , (* * * * *) .
Edit
OP , PWD .
PWD =/my_django_project_path/helpers/management/commands /etc/environment
, , , , cron.
, , cron.
, .netrc , - ( sudo root), .