nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Downloading files from ftp server with mget command

This is a discussion on Downloading files from ftp server with mget command within the Shell scripting forums, part of the Development/Scripting category; Hi, I want download single file from remote ftp server with mget command. Files are in following format. BBY_product_file_200805240250.zip BBY_product_file_200805250250.zip ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-27-2008, 06:21 AM
Junior Member
User
 
Join Date: Jan 2008
My distro: Debian
Posts: 4
Rep Power: 0
nageshms is on a distinguished road
Smile Downloading files from ftp server with mget command

Hi,

I want download single file from remote ftp server with mget command.

Files are in following format.

BBY_product_file_200805240250.zip
BBY_product_file_200805250250.zip
BBY_product_file_200805260250.zip

I want to download latest file daily. I tried with following commad but didn't work.

$mget BBY_product_file_%date:~-4,4%%date:~-10,2%%date:~-7,2%0250.zip

Can someone help me on this ASAP.

Thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-28-2008, 12:52 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 917
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default


Code:
NOW=$(date +'%Y%m%d%H%M')
FILE="BBY_product_file_$NOW.zip"
mget $FILE

__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
diff command to exclude files that match pattern piggy Getting started tutorials 1 08-13-2007 10:52 PM
linux command search server for string chimu Linux software 2 07-26-2006 12:40 AM
Linux searching for files in the server jerry Getting started tutorials 1 06-20-2006 05:12 PM
Downloading Linux distro or kernel from indian mirror sites rockdalinux Getting started tutorials 1 01-28-2006 01:08 PM
script for uploading files to a FTP server marinm Shell scripting 7 01-02-2006 07:35 PM


All times are GMT +5.5. The time now is 04:22 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36