Hi All,
I have many location servers that we do nightly backups on and then scp the file to a central server. I have created a user on each server and added their public keys to the central server. I would like the cronjob to be run as root. But in the script su to the username that was created so it can scp with no password because of the public keys. This is what I tried to use but it does not work. Could you please suggest changes that should be made.
#!/bin/sh
su joesomebody \
scp \
/usr/local/var/backup7pm/joesomebody-backups* \
joesomebody@xfer.someplace.com:/backup/
Thank you,
Nazs