Find the answer to your Linux question:
Results 1 to 3 of 3
Ok I am trying to set up a script that uses SCP and will run via cron to go out 3 nights a week and pull down the zip files ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    1

    SCP for File Backup

    Ok I am trying to set up a script that uses SCP and will run via cron to go out 3 nights a week and pull down the zip files that are created of my website on my hosting server. I am having trouble setting up the SCP script that will automate this. I don't want to have to enter a password each time. I know this can be done with public/private keys but need help with the syntax. Below is an example of what I have. Any help would be great!!

    scp -i /.ssh/authorized_keys.pub usernameremotehost:/public/backups/*.t.gz /public/backups/
    Thanks
    dbnorton

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Unless you have the keys in a non-standard location, you shouldn't have to specify the file path.

    Also, you're pointing to the public key in your example above, but the identify file should be the private key. (The public key is on your server.)

    scp(1): secure copy - Linux man page

    OpenSSH Public Key Authentication

  3. #3
    Just Joined!
    Join Date
    Feb 2009
    Posts
    54
    What I would do is add the public key on the remote host, and just get it working locally without password for the user the script is going to run as. Once you have that working, the script should work too, and you dont have to point to the key location.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...