Skip to content

cron and pull() #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
publicstaticvoid opened this issue Sep 27, 2011 · 4 comments
Closed

cron and pull() #31

publicstaticvoid opened this issue Sep 27, 2011 · 4 comments

Comments

@publicstaticvoid
Copy link

hi im writing a python script which i want to backup my git repositories every day...
so im trying to run it as a cron job under my user profile...
it runs fine from the command line...

although when cron tries to run it i get an error in the syslog: (CRON) error (grandchild failed with exit status 1)..

upon testing it seems is the pull() call where it is having an issue...

my only thought is that it maybe be a permissions/key issue as im trying to pull from a remote...

has anybody come across this issue?

am i doing something wrong?

any help would be great as it would be really cool to automate this...

thanks

@publicstaticvoid
Copy link
Author

is this even the right place to be asking about this?

@Byron
Copy link
Member

Byron commented Sep 27, 2011

Hi,

Cron will unset your environment to something usually not suitable to run commands like git.
Please see this post for help:

http://stackoverflow.com/questions/2229825/where-can-i-set-environment-variables-that-crontab-will-use

Besides, you can always directly specify which git executable git-python will use, by setting the GIT_PYTHON_GIT_EXECUTABLE environment variable, but please note this might only be available in the latest release of the 0.3 branch.

Cheers,
Sebastian

@Byron Byron closed this as completed Sep 27, 2011
@publicstaticvoid
Copy link
Author

[SOLVED]
ok thanks for the reply byron...
i solved the issue by setting the "SSH_AUTH_SOCK" environment variable...
os.environ["SSH_AUTH_SOCK"]
although id have to edit this everytime the machine restarts...

@Byron
Copy link
Member

Byron commented Oct 24, 2011

Good to know - thanks for sharing your insights with us !
Maybe you will find out what a permanent fix would be, and post it here as well.
Thanks,
Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants