- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Download files to local server using ftp script ba...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 02:29 AM
тАО01-07-2011 02:29 AM
I have written one ftp script which will download some files from ftp server and scheduled this in cron.
Daily this script will run and download the files to local server.
It is running successfully.
Now the problem is some times the source system is not placing the files in server due to some problem at their end.
As we dont know this our script is downloading the previous day files.
Please let me know how to check the modified date in ftp. So that I will check date then download the file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 04:49 AM
тАО01-07-2011 04:49 AM
Re: Download files to local server using ftp script based on date.
To run on what?
uname -a
> Please let me know how to check the
> modified date in ftp. [...]
Uh, have you considered using a "dir"
("LIST") command?
You might look into wget, particularly its
"--timestamping" ("-N") option.
http://www.gnu.org/software/wget/wget.html
(This wheel has already been invented.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 04:52 AM
тАО01-07-2011 04:52 AM
SolutionYou need to look at the manpages for 'ftp(1)'. Therein you will find two options that will assist you:
# modtime remote-file
...which shows the last modification time of remote-file
# newer file-name
...which gets the file only if the modification time of the remote file is more recent that the file on the current system
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 05:45 AM
тАО01-07-2011 05:45 AM
Re: Download files to local server using ftp script based on date.
That depends a bit on the FTP server. One
possible outcome, for example:
ftp> modtime robots.txt
502 MDTM is unimplemented.
But you could get lucky. With my weak
psychic powers, I wouldn't try to guess the
capabilities of "ftp server" "at their end"
without more (that is, some) actual
information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 07:32 AM
тАО01-07-2011 07:32 AM
Re: Download files to local server using ftp script based on date.
when I am trying to use modtime for directories, I am getting the error
"550 Could not get file modification time."
Is there any way to use for folders as well??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2011 07:48 AM
тАО01-07-2011 07:48 AM
Re: Download files to local server using ftp script based on date.
> when I am trying to use modtime for directories, I am getting the error "550 Could not get file modification time." Is there any way to use for folders as well??
I don't think so. You could use something like 'dir' to collect a listing (with dates) of the files in a directory and then parse that list, though.
Regards!
...JRF...