# rsnapshot + cron not copying from remote servers via ssh

## ubermonkey

I love using rsnapshot to keep backups without taking up a lot of space.  Well, most of the time.  Recently it's been acting a little weird.  Maybe you can help me out?  It's copying local files just fine, but it's not catching remote files via ssh.  That usually indicates to me that cron started before ssh-agent (via keychain) did, so restarting cron used to do the trick.  But not anymore, for some reason.  

The weird thing is running "rsnapshot hourly" from the command line works just fine.

Here are the errors cron mails to me:

 *Quote:*   

> 
> 
> Permission denied, please try again.
> 
> Permission denied, please try again.
> ...

 

A portion of my rsnapshot.conf file:

 *Quote:*   

> 
> 
> backup  joel@(myserver1):/Users/joel/Library/   (myserver1)/
> 
> backup  root@(myserver1):/private/var/log/  (myserver1)/
> ...

 

Any ideas?  What additional information would help you?

Thanks!

----------

## ubermonkey

Trying a few more things, I've discovered that running the individual rsync commands as root or my normal user work fine, but when run using sudo or cron, I get these errors.  Does that point to anything obvious?

----------

## donande

I also had problems running scripts through rsnapshot. After hours of searching for the reason I saw that in crontab $HOME is set to /. So the $HOME of root is overridden.

Setting HOME in crontab to "/root" solved my issues.

greetings Andreas

----------

