Solved

Plink get today's files to txt file

Posted on 2014-01-15
2
666 Views
Last Modified: 2014-01-20
What command should i use to get written off to a local text file all the files created "Today" (not the las 24 hours, but al the files created after 00:00 the current day), ordered by name?

would it be something like..

plink -P port -l user -pw pass machineName  "command here" >> myfile.txt 2>&1
0
Comment
Question by:celtician
2 Comments
 
LVL 4

Assisted Solution

by:popesy
popesy earned 200 total points
ID: 39784760
Hi

You could try the 'stat' command in linux (I think this depends on your disto however).

For the stat command try;

stat -c %W filename

or

stat -c %w filename

It doesn't look like you are after a command for an AIX platform here, as you can get the creation time from the file system database that JFS2 provides.

Good luck

Cheers, JP.
0
 
LVL 29

Accepted Solution

by:
serialband earned 300 total points
ID: 39786818
Plink thinks that your redirect is part of the command being passed to the remote hose.  You need to put parenthesis around the command and redirect that output to your local windows system.
(plink -P port -l user -pw pass machineName  "command here") >> myfile.txt 2>&1


Did you just want to copy a file from the server to your Windows system?  You would use pscp.exe for that.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question