Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Plink get today's files to txt file

Posted on 2014-01-15
2
Medium Priority
?
683 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 5

Assisted Solution

by:John Pope
John Pope earned 800 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 31

Accepted Solution

by:
serialband earned 1200 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month6 days, 15 hours left to enroll

783 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