Results 1 to 5 of 5

Thread: rsync with password

  1. #1
    Join Date
    Jun 2009
    Beans
    86

    rsync with password

    Hi Guys

    I need the correct command to sync a remote server with a local server so i can run it as a cron job I need it to check for and copy all updated files including subfolders and files whilst keeping all file and folder attributes

    Currently i do it manually and entering the password when requested using the following
    rsync -a user@IPADDRESS:/Source folder/ DESTINATION

    I need to add this as a cron job where I can also send the password without being asked for it.

    Any help would be greatly appreciated

    P

  2. #2
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: rsync with password

    You can try importing you local keys to the remote computer so that you can run ssh/rsync with password. This is the recommended way in scripts and cron jobs.

    You just have to do this the first time only.
    First create your keys:
    Code:
     ssh-keygen
    Just keep pressing enter to accept defaults.

    Then copy your ID to the remote machine.
    Code:
     ssh-copy-id user@IPaddress
    Input the password.

    Now try your rsync command or try to ssh again on the server and you should login automatically.

  3. #3
    Join Date
    Jun 2009
    Beans
    86

    Re: rsync with password

    Hi nerdtron
    That seems to have worked great thanks
    Do you happen to know the correct flags to sync only the files or folders that have been added or updated since the last sync whilst keeping all attributes?

    P

  4. #4
    Join Date
    Jun 2009
    Beans
    86

    Re: rsync with password

    would i be right in thinking -a -–update would do this ?

  5. #5
    Join Date
    Jun 2009
    Beans
    86

    Re: rsync with password

    found it rsync -a -u

Tags for this Thread

Bookmarks

Posting Permissions

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