Find the answer to your Linux question:
Results 1 to 2 of 2
I am about to mass copy files from one server to another with rsync. It will be about 100 user accounts (below is just an example). I suck at shell ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    6

    input a password at each prompt


    I am about to mass copy files from one server to another with rsync. It will be about 100 user accounts (below is just an example). I suck at shell code. But I am going to put this in a shell script to run. But the problem is after each line it will prompt for the server password. How can I automate this process? I know it would be insecure but it's just a one time thing to run.

    #!/bin/sh
    rsync -trl --progress -e ssh /home/scott/Maildir/ scottm&172.16.0.58:/var/vmail/example.com/scott
    rsync -trl --progress -e ssh /home/aaronp/Maildir/ scottm&172.16.0.58:/var/vmail/example.com/aaronp
    rsync -trl --progress -e ssh /home/allen/Maildir/ scottm&172.16.0.58:/var/vmail/example.com/allen

  2. #2
    Linux User
    Join Date
    Dec 2011
    Location
    Turtle Island West
    Posts
    367
    I would probably rsync them all to a local directory and then rsync that directory over the net so I only have to enter the password once.

    Another option would be to temporarily blank the password and restore it after the transfers. Not a good idea.

    Couldn't you rsync /home/*/Maildir or something so you just call rsync once instead of multiple times?

Posting Permissions

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