On 13.09.24 14:24, Marcus Park wrote:
Hi list,

I have put the private key into my debian VPS (in ~/.ssh/ dir).

When I scp a file from this VPS to another one by hand without password, it works.

But when I put this scp into crontab, it seems not work. The scp in crontab via private key didn't run as I expect, nothing was copied to peer.

Can you help?

Thank you.
Marcus


Cron doesn't know anything about your environment variables.
You can set PATH or HOME or use absolute paths.

/usr/bin/scp -i /home/userYX/.ssh/myKEY r...@example.com ...

Best regards,

Reply via email to