LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs > catkin
User Name
Password

Notices



Rate this Entry

VBS for cwrsync - RSYNC_PASSWORD gotcha

Posted 12-23-2011 at 01:19 AM by catkin
Updated 12-23-2011 at 01:20 AM by catkin (Added comment moderation and email notification)

When running cwrsync as SYSTEM it difficult to satisfy rsync's requirement that the password file must be owned by root and readable only by root.

One solution is to set the RSYNC_PASSWORD environment variable.

When using Visual Basic Script to automate the cwrsync run, there's a "gotcha" -- RSYNC_PASSWORD must be a SYSTEM environment variable, not a USER environment variable.

Sample code:
Code:
objWshShell.Environment("SYSTEM").Item("RSYNC_PASSWORD") = strPassword
and, to unset it:
Code:
objWshShell.Environment("SYSTEM").Remove("RSYNC_PASSWORD")
When the VBS is run as a Scheduled Task with RSYNC_PASSWORD a USER environment variable, rsync hangs, prompting for a password that cannot be entered. The rsync server log contains a single line, something like:
Code:
2011/12/22 22:50:12 [2100] connect from CW8vWXP.localdomain (192.168.168.3)
Posted in Uncategorized
Views 960 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration