473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

getting info on remote files

hello everyone,

Im trying to write some python code that will return information (file
size, last modified ...) about files on a remote computer that I have
'no password' ssh access to. Ive been able to write code that logs on
to remote computers and I can issue a command using,

os.system(ssh blah.blah.blah.org "ls -l myfile")

but how do I store the information returned by the ls command into a
variable. The primary goal of this is to
1. check file size on remote computer
2. scp file to local computer
3. make sure file size of copy and original are the same

any suggestions would be appreciated

thanks
gabe

Feb 26 '07 #1
1 2057
ga***********@gmail.com wrote:
hello everyone,

Im trying to write some python code that will return information (file
size, last modified ...) about files on a remote computer that I have
'no password' ssh access to. Ive been able to write code that logs on
to remote computers and I can issue a command using,

os.system(ssh blah.blah.blah.org "ls -l myfile")

but how do I store the information returned by the ls command into a
variable. The primary goal of this is to
1. check file size on remote computer
2. scp file to local computer
3. make sure file size of copy and original are the same

any suggestions would be appreciated

thanks
gabe
Why not just use rsync across the ssh tunnel to synchronize the remote
file to local file? This works great and you don't have to do much.

-Larry
Feb 26 '07 #2

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

Similar topics

11
by: juglesh | last post by:
at one centraldomain.com, I have central.php, which consists of this: <?php function square($num) { return $num * $num; } ?> at outerdomain.com, I have test.php, which consists of this:...
5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
3
by: Nick Bunton | last post by:
I have setup remote debugging on an NT4 workstation for testing. I then build from the debug config on my machine and copy all the files from the /bin/debug folder including the .PDB files. I then...
3
by: Alexander Wehrli | last post by:
Hello, I'd like to write an application that finds out for every machine in my network that it is running and if yes, which user is logged on this machine. I'm asking myself if this is possible...
1
by: Paolo | last post by:
I have been following a few walkthroughs that came with VS 2005, and they work fine (I had to change the machine.config files to work with my SQL 2005 Pro version, instead of the SQL 2005 Express)....
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
11
by: Robin S. | last post by:
I've used phpinfo() to confirm settings for mySQL on our host server, and it's not returning accurate info. phpinfo() returns a mySQL client API version of 3.23.54 (uselss for me), where as a...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.