01-15-2019
You seem to imply that the filetime (Last time the file was written) kept by UNIX is not what you want, but the "date" kept in the filename? Is that correct?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a problem.
I have some text files in a folder. The names can be like:
emp_20080307053015.dat
emp_20080306053015.dat
emp_20080305053015.dat
emp_20080304053015.dat
The date format appended is like yyyymmdd and timestamp.
What i need is i have to copy the latest file every... (3 Replies)
Discussion started by: Aswarth
3 Replies
2. Shell Programming and Scripting
Hello all, this is my first post while i am trying to understand unix.
I would basically like to know if i can do this:
Lets say i have a folderA and folderB
And i save something in folderA
Can i make a script that checks folderA latest file, then compares it with the date of latest file in... (16 Replies)
Discussion started by: takissd
16 Replies
3. Shell Programming and Scripting
Hi,
I want to download the latest file published on remote server using SFTP connection.
The job will run at every 15 min hence should download only the latest file. The fileName will be like ABC_DDHHMISS.txt (DD- day, HH-hour, MI - Min, SS-Sec).
So there will be files with same date for... (23 Replies)
Discussion started by: ssachins
23 Replies
4. Shell Programming and Scripting
Hi All,
I am SFTP ing file from Windows server (Sydney) to Unix host in London (both servers are on different timezones). It appears the upstream (Windows server team) does not do a file housekeeping activity and henceforth there are multiple files i.e. each week the script is scheduled to run... (1 Reply)
Discussion started by: vigdmab
1 Replies
5. Shell Programming and Scripting
Hi All,
In my unix server, I have the following files:
h1.txt
h2.txt
h3.txt
and through SFTP i need to copy only the latest file to another unix server.
Can you please let me know what command i need to use.
Thanks in Advance, (2 Replies)
Discussion started by: HemaV
2 Replies
6. UNIX for Dummies Questions & Answers
#!/bin/bash
for i in {1..1536..1}
do
#find /home/test/Desktop/up111/workplace/Malware/$i/logs
for a in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
#max=a
for b in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
... (4 Replies)
Discussion started by: upvan111
4 Replies
7. UNIX and Linux Applications
Hi All,
One job in unix server will generate .csv files daily. I need to copy the latest of these .csv file from the unix server to the shared drive/folder in windows through unix script. My shared folder will look something like
W:\some folder(for example). Could any one of you please help... (3 Replies)
Discussion started by: jaya@123
3 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I need your help in finding the latest files in remote sftp and get those files to local server and process them. Please let me know
I appreciate your valuable inputs.
Thanks
raj (7 Replies)
Discussion started by: rajeevm
7 Replies
9. Shell Programming and Scripting
hi,
i have some file in a directory say
p1.txt.201305051200.lst
p1.txt.201305051300.lst
p1.txt.201306051200.lst
p1.txt.201306051300.lst
p2.txt.201306051200.lst
p2.txt.201306051300.lst
i am using p* pattern to retrieve these file
ls -1 p*
the files in red color are the latest... (7 Replies)
Discussion started by: Little
7 Replies
10. Shell Programming and Scripting
hi guys the script is working but i need to change the file that i want to get to the latest.. i will use this as cron so i can get the latest sftp file evryday.
pls help..
set user "big_user"
set IP "XX.XX.XX"
set dir "/export/home/oracle/REF/INPUT"
spawn sftp $user@$IP
expect sftp>
... (7 Replies)
Discussion started by: JONATHAN0919
7 Replies
LEARN ABOUT REDHAT
file::listing
File::Listing(3) User Contributed Perl Documentation File::Listing(3)
NAME
parse_dir - parse directory listing
SYNOPSIS
use File::Listing;
for (parse_dir(`ls -l`)) {
($name, $type, $size, $mtime, $mode) = @$_;
next if $type ne 'f'; # plain file
#...
}
# directory listing can also be read from a file
open(LISTING, "zcat ls-lR.gz|");
$dir = parse_dir(*LISTING, '+0000');
DESCRIPTION
The parse_dir() routine can be used to parse directory listings. Currently it only understand Unix 'ls -l' and 'ls -lR' format. It should
eventually be able to most things you might get back from a ftp server file listing (LIST command), i.e. VMS listings, NT listings, DOS
listings,...
The first parameter to parse_dir() is the directory listing to parse. It can be a scalar, a reference to an array of directory lines or a
glob representing a filehandle to read the directory listing from.
The second parameter is the time zone to use when parsing time stamps in the listing. If this value is undefined, then the local time zone
is assumed.
The third parameter is the type of listing to assume. The values will be strings like 'unix', 'vms', 'dos'. Currently only 'unix' is
implemented and this is also the default value. Ideally, the listing type should be determined automatically.
The fourth parameter specifies how unparseable lines should be treated. Values can be 'ignore', 'warn' or a code reference. Warn means
that the perl warn() function will be called. If a code reference is passed, then this routine will be called and the return value from it
will be incorporated in the listing. The default is 'ignore'.
Only the first parameter is mandatory.
The return value from parse_dir() is a list of directory entries. In a scalar context the return value is a reference to the list. The
directory entries are represented by an array consisting of [ $filename, $filetype, $filesize, $filetime, $filemode ]. The $filetype value
is one of the letters 'f', 'd', 'l' or '?'. The $filetime value is the seconds since Jan 1, 1970. The $filemode is a bitmask like the
mode returned by stat().
CREDITS
Based on lsparse.pl (from Lee McLoughlin's ftp mirror package) and Net::FTP's parse_dir (Graham Barr).
libwww-perl-5.65 1999-03-20 File::Listing(3)