Sign in to follow this  
Followers 0
JBeardNC

Using AutoIt to run cwRsync

4 posts in this topic

Hey everyone. We are implementing cwRsync in our environment and for those who are familiar with it, you know it is basically a command line utility that is run from a .bat or .cmd file. Below is the .bat file that I've written and it works perfectly to backup my files to a remote computer called BACKUP-PC. However, my management does not like how anyone could open the file in Notepad and view the password so I told them that I thought I could write it in AutoIt and then compile it into .exe format so that the password would not be in plain text for everyone to see. I'm trying to figure out the best way to do this. Using the example below, is it possible to make this into AutoIt? I've used @comspec before but what about the two SET commands at the top. How do I set those two variables since they are variables that are for the rsync executable, not variables for the script? For example, in AutoIt, if I put Run(@comspec & " /c " & "SET CYGWIN=nontsec") on one line and then Run(@comspec & " /c " & "SET RSYNC_PASSWORD=pa55w0rd") on the next line, doesnt that run those two lines separately and once they run, the variables are erased from memory? Maybe I'm wrong, I dont know much about the SET command. If anyone has any ideas, please let me know. Thanks!

.BAT file looks like this...

SET CYGWIN=nontsec
SET RSYNC_PASSWORD=pa55w0rd

cd "%ProgramFiles%/cwRsync/bin/"

echo "Start Time is " %TIME%

rsync --stats -vru --log-file=/cygdrive/c/rsync.log --chmod u+rwx --super /cygdrive/c/Files* %USERNAME%@BACKUP-PC::%USERNAME%/Files

echo "Finish Time is " %TIME%
pause

Share this post


Link to post
Share on other sites



What you've pasted for your .bat file doesn't make a whole lot of sense...

Using the SET command is basically declaring a variable for use in your .bat file, but you never use either of the variables you've declared...?

Share this post


Link to post
Share on other sites

They are for the program not for the command shell. Look up EnvSet() function in the help file, the cd "%programfiles%\cwrsync\bin" can be replaced by the second parameter of Run/RunWait functions.

Share this post


Link to post
Share on other sites

They are for the program not for the command shell. Look up EnvSet() function in the help file, the cd "%programfiles%\cwrsync\bin" can be replaced by the second parameter of Run/RunWait functions.

Thanks Authenticity! Thats exactly what I was looking for! Appreciate the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0