Software :: Automated Download Problem - Shell Ftp Vs Perl

Jun 1, 2009

I recently set up an automated shell script (bash on Ubuntu 8.10) to download new files from a server using ftp. Unfortunately the other end of the link is not terribly stable (and there is nothing I can do about this) which has resulted in the script hanging sometimes and then being kicked off again at the time set in the crontab.

This has resulted in multiple hung sessions taking up all the system resources.

The offending section of code is given below.

Code:

I'd like to know if there is a way I can force an exit if the connection hangs or alternatively if something like the Perl Net::FTP can handle these sorts of errors internally.

View 3 Replies


ADVERTISEMENT

General :: Automated Installation With Perl?

May 21, 2011

I am making some scripts to automaticly install linux-software.gcc,kernel,binutils, etc.) I have made a command to extract the packages, but how can I check if I can re-use my already extracted source-archives?

View 3 Replies View Related

General :: Create An Automated Shell Script?

Sep 16, 2010

I am a complete newbie to linux. I am currently taking a course at Devry university called netw240. I am in my 2nd week of class and am required to turn in a paper at the end of the coures were I write an automated shell script. I am currently using Fedora 12 on a Vmware player and want to try to write a script that automates the process of Logging user login activity to detect unauthorized remote access attempts.I am looking for pointers on were to start, examples, ect.. anything that can get me started. Also, is this type of script to much for a beginner?

View 11 Replies View Related

Programming :: Automated Ftp Download Of File With A Name That Changes

Apr 30, 2010

I am trying to create a script to do the following.. Login to a ftp and download a with the following naming convention xmtvMMDDYY.xml.gzon a daily basis followed by extracting that file. which I can do easy enough with a static filename. but the variable filename is throwing me off. I was planning on doing a mget with wildcard to just grab the entire directory but this found to not be as clean as I had hoped. Mainly due to the admins of the ftp keeping multiple days of the above mentioned file on the site.

View 2 Replies View Related

Networking :: Run Shell Script From Perl?

Sep 4, 2010

i want to run/call shell script from perl, i used this system( "sh", "script.sh", "--help" );The 'script.sh' contains IPTables firewall script, but that's not run.i test 'script.sh' with a simple thing such create a chain only, but it not doing.How to run a shell script from a Perl program?

View 4 Replies View Related

Server :: Running A Shell Script With Perl?

Jun 27, 2009

quick guidance on running a bash script using Perl. The script is calledarchive_web.sh.The regular script I have and use now (archive.sh) creates an archive directory (uses the current date as the dir name) and moves all existing files there.The script is cronned to run every day before midnight. I'd like to be able to run this "archiving script"manually, from the web, at my own discretion, rather than necessarily wait till midnight (but want it to run then, too, in case any new files present themselves in the directory).These shell scripts sit in an .htaccessed directory. Talk about making up verbs all over the place.

View 1 Replies View Related

Programming :: Call Shell Script In Perl Pm

Sep 4, 2010

i used ldap for authentication.now i have a perl script that users use it for login(contact.pl),then this script calls a shell script(ip.sh) for create iptables chain.

when i call that into contact.pl ,it just prints: usr/sbin/iptables but ip chains didn't change.what is problem? whenever run ip.sh in bash it works correctly

View 10 Replies View Related

Programming :: Download Files Using Perl?

Jul 24, 2010

How do I download a file to a specified location on disk in Perl?I tried doing a few web searches but suprisingly couldn't find anything.

View 4 Replies View Related

Programming :: Compare Two Files Using Perl Or Shell Scripting?

Mar 8, 2010

I want to compare the following two tab-delimited .txt files (both were subsets of the original files) by comparing Columns 3 and 4 simultaneously. It is easy to compare C3 because both C3s are just numbers. But how to compare C4s?Basically, in File1, "G,G" = G in File2, "C,C" = C in File2, "A,A" = A in File2, "T,T"= T in File2.In File2, A/T in Column4 just equals "A,T" or "T,A" in Column4 of File1. C/T in Column4 just equals "C,T" or "T,C" in Column4 of File1, and etc.

File1:

C1C2 C3C4
ih509rs12345467244750"G,G"
ih499rs6049687244911"C,C"
ih508- 7244977"A,A"

[code]....

View 2 Replies View Related

Programming :: 32512 Error Code In Perl When Trying To Run Shell Command?

Nov 29, 2010

when I execute the command from the shell command line - it works and no error code.if I do the exact same command from a perl file - it fails with code 32512.the file is created from the same perl script that runs the command that fails. file permission is 0664.

Code:
#! /usr/local/pkg/perl-5.8.8/bin/perl
print "Content-type: text/html

[code]...

View 3 Replies View Related

Ubuntu :: Correct Usage Of Perl Expression In 'rename'-shell Command

Jan 21, 2011

I want to rename some files in one directory and found the command 'rename' most appropriate.

Changing the file extension is easy since there are lot of examples for this.

But now I want to rename my files like this:

'somePrefix_blablabla.ext' --> '0_blablabla.ext'
'somePrefix_blablablablabla.ext' --> '0_blablablablabla.ext'

I DON'T want an incrementation, just the leading prefix '0_'

correct perl expression syntax for this?

View 2 Replies View Related

Programming :: Perl About System Command / Fails If The Standard Shell Is Dash And Not Bash?

Jun 30, 2011

I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.

The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.

I searched for it and found this link:url

My plan is to include this function:

Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?

The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?

In the script there are lots of places like this:

my $error = system($cmd);
if ($error) {
die/warn "some error message";
}

Shouldn't there be a return in the system_bash function?

View 8 Replies View Related

General :: Finding A Recursive Shell Or Perl Script To Delete Files With The Same Name As The Parent Folder?

Jun 29, 2010

is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.

View 2 Replies View Related

General :: Crypt() Perl Function To Encrypt Password In Shell Scripts Or Encrypt Passwords?

Jan 8, 2010

I Have shell script like this

Code:
#!/usr/bin/expect
set password "XXXXXXXX"

[code]...

View 13 Replies View Related

Ubuntu :: Download A File Via HTTP From A Shell?

Mar 28, 2011

How can I download a file via HTTP from a shell?

View 3 Replies View Related

Networking :: Up-/download Rate For A Single Host (from Shell)?

Jan 25, 2011

I have a slave node uploading all kinds of backups to my server in the internet. Now I would like to display the actual upload and download rate to this server (not the entire nic-traffic, any protocol) in a small php-page for easy monitoring.I had a look at quite some monitoring tools and the one which kind of offers what I am looking for is iftop with a filter on the IP of my server. As I would like to periodically update a file with the actual rates, an interactive program won't do. A possibility would be to filter the packages myself using but this seems to be quite a long shot.The optimal solution would be a program or script printing out the actual upload to a host specified in the options to STDOUT

View 3 Replies View Related

General :: Shell Script Using Wget To Download Files From Ftp, Sub Directories?

Apr 27, 2010

I need to small shell script that I can download hdf data from ftp://e4ftl01u.ecs.nasa.gov/MOLT/MOD13A2.005/first,file name.MOD13A2.A2000049.h26v03.005.2006270052117.hdf each sub folders.next I copy all files with h26v03 to local mashine.

View 1 Replies View Related

Programming :: Shell Scripting: Trying To Combine Upload And Download Totals From Txt File By Ip Add

Sep 6, 2010

I have two files, uploads.txt and downloads.txt. I would like to combine the columns of these files based on the ip address. How can I best do this?

Uploads.txt Code: 192.168.0.147 1565369
192.168.0.13 1664855
192.168.0.6 1332868 Downloads.txt Code: 192.168.0.147 9838820

[code]...

View 7 Replies View Related

CentOS 5 Server :: Move 5.5 To /usr/bin/perl So Root Based On Perl 5.12.1?

Aug 11, 2010

I am new here and want to lern CentOS. Current I have installed CentOS 5.5 x64 and Perl 5.8.8. Now i have install Perl 5.12.1 which located to /usr/local/bin/perl. But how I can move it to /usr/bin/perl so root based on Perl 5.12.1?

View 7 Replies View Related

Debian :: Launch The Perl Config \ Seems To Be That It Does Not Regonize Perl?

Jul 7, 2010

I am trying to launch the perl config, but when I do so I can an weird error.It seems to be that it does not regonize perl ?

conf.pl: line 11: =: command not found
conf.pl: line 19: my: command not found
conf.pl: line 20: syntax error near unexpected token `{'

[code]...

View 2 Replies View Related

Ubuntu :: Switch Back To /usr/bin/perl After Installing Second Perl?

Aug 14, 2010

I recently reinstalled the B module for perl. Now I found out it didn't just do that, it installed a whole new copy of perl into /usr/local/bin/perl. When I type 'which perl' at the terminal, it says '/usr/local/bin/perl' instead of '/usr/bin/perl'. Normally, this wouldn't bother me. But I installed the one in local/bin without threading support. The one that comes with the system already is build with threading support, which is why I want to switch back to the system perl, and possibly remove the one in /usr/local/bin.

So how do I change it so that the result of 'which perl' returns as '/usr/bin/perl'? And what do I have to do to remove /usr/local/bin/perl?

The reason I need threading support is because I'm designing a file copier that copies several chunks of a file simultaneously to speed up the copying process. Guaranteed a useful script if it works.

View 7 Replies View Related

OpenSUSE :: Difference Between Perl And Perl-devel?

Jun 28, 2010

I'm new in perl programming and linux OS. What is the difference between perl and perl-devel? What does mean devel? Iwant to install Catalyst and before install as required I have to check if make, gcc and perl-devel are installed in my system. make and gcc are installed. But I have to install perl-devel. First I searched for make, gcc and perl-devel in YAST Software Management and search did not find perl-devel. I visited the software.opensuse.org and wrote "perl-devel" and searched. The result was many similar zips with a prefix perl-devel and I can not choose one for needed perl-devel.

[Code]...

View 5 Replies View Related

Fedora Networking :: /usr/bin/perl: Symbol Lookup Error: /usr/bin/perl: Undefined Symbol: PL_use_safe_putenv

Apr 8, 2009

I am trying to setup the wlan access for my Fedora 9 system. I installed ndiswrapper. But when I run

Code:

ndiswrapper -l

i am getting the error

Code:

/usr/bin/perl: symbol lookup error: /usr/bin/perl: undefined symbol: PL_use_safe_putenv

View 11 Replies View Related

CentOS 5 Server :: Unable To Give "Perl Path" To Run Perl CGI Script

Jun 2, 2011

I am unable to run perl-cgi script in my cent os Apache server. I have used locate perl command in terminal window and it gives following result:

[code]....

tell which is the path to perl for example "usr/bin perl"

View 13 Replies View Related

General :: Use "#!/usr/bin/perl" In The Beginning Of A Perl Script

Dec 17, 2010

I have a small problem with Perl and Apache.

If I use "#!/usr/bin/perl" in the beginning of a perl script the script won't work if the script is at all complicated. Simple scripts like "Hello World" works.

But if I use "#!/usr/bin/perl -w" in the beginning all scripts work?

If I don't use the -w this is whats in the logs:

(2)No such file or directory: exec of '/home/test.net/html/cgi-bin/uh/meny.pl' failed

Premature end of script headers: meny.pl

When I use the -w in the script the error-log shows me this.

meny.pl: Name "main::http_path_cgi" used only once: possible typo at /home/test.net/html/cgi-bin/uh/meny.pl line 24.

View 1 Replies View Related

Debian :: Automated CLI / GUI To Make .deb From Source?

Jul 30, 2011

Presently I am following [./configure | make | checkinstall] way for local box.
And need gpg signature , copyright etc... for disturbing

Is there any automated CLI/GUI tool to make .deb from source ?

View 14 Replies View Related

Fedora :: Automated Mouse Cursors?

Mar 7, 2010

It there a way to enable automated mouse cursors in Fedora 12? About the only thing I miss from WinDoze is the animated hourglass cursor when I start an application by double-clicking its icon. With Fedora, I'll sometimes double-click an icon again, thinking that my first attempt didn't work, only to find that the program was loading and then I have two instances of the program.Yeah, it's a minor thing and, yeah, I can live without it, but it sure would be nice.

View 1 Replies View Related

Ubuntu :: Way To Have Automated System Backups?

Apr 23, 2010

What would be the best way to have automated system backups? I'm trying to get it so my Xubuntu box automatically backs up the entire system including user settings on regular intervals, what would be the best way to do it? I have 2 hard drives with one that I do not use that I'd like to backup to.

View 2 Replies View Related

Programming :: Toolkits To Do Automated GUI Testing?

May 13, 2010

I am involved in a project where some regression tests are to be automated. Could you please tell me what are the testing tools that are available for doing automated GUI testing in Linux?

View 2 Replies View Related

General :: Automated User Loggin?

Feb 6, 2010

how to automate user's loggin ?can we do something like the user get automatically looged in without displaying the welcome screen..?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved