Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Raúl Cumplido
Hi, I would recommend you to migrate your Python version for a newer one where you can use fabric, paramiko or other ssh tools. It would be easier. I would recommend also instead of doing an ls -l command doing something to retrieve only the information you need: /bin/ls -ls | awk '{print

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Stefan Behnel
Raúl Cumplido, 27.06.2014 12:10: I would recommend you to migrate your Python version for a newer one where you can use fabric, paramiko or other ssh tools. It would be easier. +1 Even compiling it yourself shouldn't be too difficult on Linux. I would recommend also instead of doing an ls

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Walter Prins
Hi, On 26 June 2014 19:40, Albert-Jan Roskam fo...@yahoo.com wrote: snip I'd probably rather try Paramiko's SFTPClient and retrieve the file modified date directly: http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html#paramiko.sftp_client.SFTPClient (see the SFTPFile.stat() method

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread leam hall
On Fri, Jun 27, 2014 at 7:41 AM, Stefan Behnel stefan...@behnel.de wrote: Raúl Cumplido, 27.06.2014 12:10: I would recommend you to migrate your Python version for a newer one where you can use fabric, paramiko or other ssh tools. It would be easier. +1 Even compiling it yourself

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Walter Prins
Hi, On 27 June 2014 12:57, leam hall leamh...@gmail.com wrote: On Fri, Jun 27, 2014 at 7:41 AM, Stefan Behnel stefan...@behnel.de wrote: Raúl Cumplido, 27.06.2014 12:10: I would recommend you to migrate your Python version for a newer one where you can use fabric, paramiko or other ssh

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Walter Prins
Hi, On 26 June 2014 18:01, leam hall leamh...@gmail.com wrote: On Thu, Jun 26, 2014 at 12:41 PM, Walter Prins wpr...@gmail.com wrote: On 26 June 2014 14:39, leam hall leamh...@gmail.com wrote: Python 2.4.3 Is there a better way to do this? I'd probably rather try Paramiko's SFTPClient and

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Leam Hall
On 06/27/14 17:40, Walter Prins wrote: Hi, On 26 June 2014 18:01, leam hall leamh...@gmail.com wrote: On Thu, Jun 26, 2014 at 12:41 PM, Walter Prins wpr...@gmail.com wrote: On 26 June 2014 14:39, leam hall leamh...@gmail.com wrote: Python 2.4.3 Is there a better way to do this? I'd probably

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Leam Hall
On 06/27/14 06:10, Raúl Cumplido wrote: Hi, I would recommend also instead of doing an ls -l command doing something to retrieve only the information you need: /bin/ls -ls | awk '{print $7,$8,$9, $10}' Jun 27 10:36 my_file Then I would use timedelta instead where you can be more accurate

Re: [Tutor] Better way to check *nix remote file age?

2014-06-27 Thread Walter Prins
Hi again ^^ On 27 June 2014 23:20, Leam Hall leamh...@gmail.com wrote: On 06/27/14 17:40, Walter Prins wrote: On 26 June 2014 18:01, leam hall leamh...@gmail.com wrote: On Thu, Jun 26, 2014 at 12:41 PM, Walter Prins wpr...@gmail.com wrote: On 26 June 2014 14:39, leam hall leamh...@gmail.com

[Tutor] Better way to check *nix remote file age?

2014-06-26 Thread leam hall
Python 2.4.3 Writing a function that takes the string from ssh server ls -l /var/log/yum.log and tries to see if the file is more than a couple months old. The goal is to only run python on the local server and it will ssh into the remote server. Is there a better way to do this? Thanks! Leam

Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread Walter Prins
On 26 June 2014 14:39, leam hall leamh...@gmail.com wrote: Python 2.4.3 Writing a function that takes the string from ssh server ls -l /var/log/yum.log and tries to see if the file is more than a couple months old. The goal is to only run python on the local server and it will ssh into the

Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread leam hall
On Thu, Jun 26, 2014 at 12:41 PM, Walter Prins wpr...@gmail.com wrote: On 26 June 2014 14:39, leam hall leamh...@gmail.com wrote: Python 2.4.3 Writing a function that takes the string from ssh server ls -l /var/log/yum.log and tries to see if the file is more than a couple months old.

Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread Albert-Jan Roskam
snip I'd probably rather try Paramiko's SFTPClient and retrieve the file modified date directly: http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html#paramiko.sftp_client.SFTPClient (see the SFTPFile.stat() method in particular, which gives you back a stat object containing mtime,