- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to ftp files which are not ftped before
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
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
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
04-08-2006 08:32 PM
04-08-2006 08:32 PM
how to ftp files which are not ftped before
I have windows folder with employees photos, every day i run ftp script form linux to transfer all the files but i want to transfer the files which are recently added to the folder.
how can i do that.
Any help is higly appreciated.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2006 09:43 PM
04-08-2006 09:43 PM
Re: how to ftp files which are not ftped before
Build a file list with the find command
find
ctime is 1 hour.
mtime may also work.
A better solution would be to install rsync or ssh for windows and use the rsync command between the two hosts.
http://www.networksimplicity.com
Provides free ssh server for windows.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2006 10:04 PM
04-08-2006 10:04 PM
Re: how to ftp files which are not ftped before
to make my self clear those files are added only once. in each ftp session i need to ftp the newly added photos for the new emplyees.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 12:01 AM
04-09-2006 12:01 AM
Re: how to ftp files which are not ftped before
if you have to use ftp for downloading files from windows to linux-you can use the following script.Simply copy it to a file on your linux,then make it executable and run.
Replace all variables starting with 'your' to relevant values.
This simple script only checks the files in certain directory on linux box then downloads from ftp all those files that aren't listed in this directory.Thus if you already have them-they won't be downloaded.
It doesn't check for newer files with the same name....
#!/usr/bin/perl
use Net::FTP;
chdir "your_dir";
@local_files=glob "*";
chomp for @local_files;
$server="your_server";
$user="your_user";
$pass="your_password";
$ftp = Net::FTP->new($server, Debug => 0)
or die "Cannot connect to $server: $@";
$ftp->login($user,$pass) or die "Cannot login ", $ftp->message;
@files_on_ftp=$ftp->ls();
chomp for @files_on_ftp;
for $remote(@files_on_ftp)
{
$found=0;
for $locally(@local_files)
{
last if $found == 1;
if ($remote eq $locally)
{
$found=1;
}
}
if ($found == 1)
{
next;
}
else
{
$ftp->get($remote) ;
print "Downloading new file $remote\n";
}
}
$ftp->quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 04:11 PM
04-09-2006 04:11 PM
Re: how to ftp files which are not ftped before
can you give the same script in shell scripting.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 04:16 PM
04-09-2006 04:16 PM
Re: how to ftp files which are not ftped before
Ugly way is to set up a '~/.netrc' with a shell-script and 'find' command, but.. messy given that the folder is hosted on a Windows box.
What you need is either a 'mirror' script, or to populate a file somewhere on the windows box with the update file's names.
Is this folder set up as a Windows share? If so, something could be mangled together using 'smbclient', but the Perl solution is good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 07:21 PM
04-09-2006 07:21 PM
Re: how to ftp files which are not ftped before
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2006 08:37 PM
04-09-2006 08:37 PM
Re: how to ftp files which are not ftped before
Thanks for your inputs, I'm not comfortable with perl scripting.
It seems that i found my way to do it in shell script.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 02:19 AM
04-10-2006 02:19 AM
Re: how to ftp files which are not ftped before
You may want to give a try to a tool called "unison"
http://www.cis.upenn.edu/~bcpierce/unison/
"Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other."
You don't need to install any server or software, just copy the .exe and invoke it when needed.