Schedule rsync at a specific time and with password input

Associate
Joined
6 Jan 2008
Posts
316
Hi there
I was wondering if some one could help me. I'm trying out ubuntu and I would like to run a rsync command which needs a password input before the sync will start.

But the part i need some help in is how to get this rsync to work at a given time & day in the week as well as inputting the password when needed.

I know this isn't the most secure method of doing things but its a temp work around I need for the moment.


thanks
 
Edit: I need to read. When you run rsync, can you pass the password through the command line (I've never used it, I'll admit)?

For scheduling it, you can use cron.
 
It's difficult to imagine a situation where you would need to enter a password for use with rsync. If you're running it locally, then you could just run it as root. If it's over a network, tunnel it over ssh and set ssh up for passwordless connection.

The syntax is something like
rsync -a -e 'ssh -p portnumber' dir1 dir2

Otherwise you're stuck with writing the password in a text file, changing the permissions on it, and reading it into the program as and when required. Something terrible like '-p `cat /root/password.txt`' is likely to result. This will work, but isn't pretty.

Cron is the obvious way to go for scheduling the command.
 
Back
Top Bottom