473,473 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Starting rsync via ASP.Net

I'm trying to automate file copying of websites between servers with a
web front end to allow our non-technical staff to make changes to sites
live in a safe and ordered manner.

I'm having difficulty using the System.Diagnostics.ProcessStartInfo
technique to start RSYNC

If I try to start RSYNC directly it doesn't terminate and does not
return control to the application.

If I try to start CMD and then pipe commands to it I do not receive
RSYNC's output.

Is there an alternative method that I may be able to try?

I'm using the following code in a C# code behind project:

System.Diagnostics.ProcessStartInfo psi = new
System.Diagnostics.ProcessStartInfo("d:\\cygwin\\b in\\rsync.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
psi.WorkingDirectory = @"c:\temp\";
// Start the process
System.Diagnostics.Process proc =
System.Diagnostics.Process.Start(psi);

// Attach the output for reading
System.IO.StreamReader sOut = proc.StandardOutput;

// Attach the in for writing
System.IO.StreamWriter sIn = proc.StandardInput;

// Close the process
proc.Close();

// Read the sOut to a string.
string results = sOut.ReadToEnd().Trim();

// Close the io Streams;
sIn.Close();
sOut.Close();

TextBox1.Text = results;

With this I would hope to see RSYNC's help output.

Mar 27 '06 #1
1 2201
Just to follow up it appears that the ReadToEnd() (Or even replacing
this with a single ReadLine() statement) causes the hold up.

Not trying to receive any output seems to be fine.

Mar 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rasmusson, Lars | last post by:
Hi, I have a problem doing I/O in a python thread. I want a thread to execute a command using os.popen, read its input until the end, and then print 'DONE' and terminate. However, the...
1
by: David Bear | last post by:
I was wondering if anyone has implemented the rsync protocol in python. -- David Bear -- let me buy your intellectual property, I want to own your thoughts --
0
by: Kurt Tragant | last post by:
Hi List, wouldn't it be possible to do a fast backup of the MySQL data in this way: 1.) rsync the MySQL data (with running mysqld) 2.) Stop mysqld 3.) rsync the MySQL data again Please...
1
by: elia Mazzawi | last post by:
Hi, i'm replacing a perl script with a C program, so the perl script used to rsync very many files to some 60 servers, and rsync was excellent for this. however the script did do a lot of...
0
by: William Dode | last post by:
Hi, I try to call rsync (with ssh) with subprocess but _some times_ it freeze without traceback, without any reason. My code look like that : def sh(self,cmd): log.debug("S cmd: " + "...
2
by: nienfeng | last post by:
Hi, everyone I want to build rsync server that can run in linux and windows, and configure by python. So I'm looking for something like rsync for python. I find rsync.py and pysync. But rsync.py...
2
by: Evan Klitzke | last post by:
Are there any python modules for accessing rsync from python? I would like to be able to rsync files from a python script to a remote server running an rsync daemon. I'm well aware that I can...
0
by: lala4life | last post by:
Currently i have cygwin installed on windows, with two executables installed SSH and rsync, this let me keep synchronized with a Linux Server. My question is: It is possible to do that without...
7
by: timw.google | last post by:
Hi I want to write a python script that runs rsync on a given directory and host. I build the command line string, but when I try to run subprocess.call(cmd), or p=subprocess.Popen(cmd,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.