Sponsored Content
Full Discussion: Crontab a Script
Top Forums Shell Programming and Scripting Crontab a Script Post 302158788 by ennstate on Wednesday 16th of January 2008 09:21:20 AM
Old 01-16-2008
Quote:
Originally Posted by moutaz1983
I know my question maybe eazy, but it realy cause a problem for me

I have a Perl script to run and get some output, I run this script using perl /moutaz/ciscolog/telnet.pl

I made another script as followSmilie/moutaz/ciscolog/script)
#!/bin/bash
perl /moutaz/ciscolog/telnet.pl
cp /moutaz/ciscolog/ciscolog /moutaz/ciscolog/ciscolog-$(date'+%H-%M')-$RANDOM

Then made crontab as follow:
15 * * * * /moutaz/ciscolog/script

The question:
-when apply command from shell it worked fine.
- from crontab it doesn't, only the cp command work.

what is the problem?

Why dont you try redirecting the cron output to some log file
Code:
 15 * * * * /moutaz/ciscolog/script >> /tmp/cron.log 2>&1

If in the perl script ( /moutaz/ciscolog/telnet.pl ) you may have used the perl instead of full path to perl,try that too

Thanks
Nagarajan G
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how can i use crontab in a script?

hi.. i wolud like to know if itīs possible use the crontab command in my script. the idea is what the script starts automatically, but i donīt know how to do it. please, help me.... thanks jonathan (1 Reply)
Discussion started by: DebianJ
1 Replies

2. UNIX for Dummies Questions & Answers

Using a script to modify the crontab

I want to add one line to the end of my crontab using a script. I have tried piping in the editor commands, but I can't get it to work. crontab -e user << EX $a This is the text I want to add. . wq EX This doesn't work. Is there an easier way to do this? (2 Replies)
Discussion started by: johnmsucpe
2 Replies

3. Shell Programming and Scripting

How to add a script to Crontab?

Hi! We are on AIX 5.3 I have a script that must be run once every hour. How do i add this to the crontab? I know how to access crontab which is, crontab -e. What do i do after that ? If i have the path to the script? Thank you!!! (4 Replies)
Discussion started by: atechcorp
4 Replies

4. Solaris

pl script in crontab

Hi I have successfukky created a sh script that runs perfectly well when run. It contains within a pl script that when run through a crontab will not run. Are there restrictions running a pl in cron? (14 Replies)
Discussion started by: rob171171
14 Replies

5. Shell Programming and Scripting

crontab script

Hi All, I am running a script to find the CPU and memory utilization of the server. Script name is atul. When i run this script then it gives the desired output as DATE, CPU and MEMORY utilization....as mentioned below: $ $ cat atul A=`date| cut -d" " -f1-4; top -d 1 -n 1 | awk '/^CPU... (5 Replies)
Discussion started by: atulbassi83
5 Replies

6. UNIX for Dummies Questions & Answers

crontab script

Hi guys Can someone help me with a crontab script please? I have to sort the files from /bin and put the first 3 of then (with size and path) in /home/user/bin_size i write the command: find /bin/ | xargs ls -lS | awk 'FNR<4{print($5, $9)}' > /home/user/bin_size which is working but when I... (2 Replies)
Discussion started by: G30
2 Replies

7. UNIX for Dummies Questions & Answers

crontab script

Hi guys Can someone help me with a crontab script please? I have to sort the files from /bin and put the first 3 of then (with size and path) in /home/user/bin_size i write the command: find /bin/ | xargs ls -lS | awk 'FNR<4{print($5, $9)}' > /home/user/bin_size which is working but when... (6 Replies)
Discussion started by: G30
6 Replies

8. UNIX for Dummies Questions & Answers

Crontab + Script + .sql

Hi guys today i'll bring to you a new problem that i need to execute. So what i need to do it's create a script that: conect to some database logon run a .sql script logoff and close the connection after that, put this script on the crontab To set up the crontab it's ok for me, i think... (3 Replies)
Discussion started by: Newer
3 Replies

9. UNIX for Dummies Questions & Answers

crontab not running script

Hi All, I am having the below script to be run from crontab, it it doesnt run. 1 * * * * /home/cobr_ext/test.sh > /home/cobr_ext/temp.txt when i run i manally it runs without any issues. Could please help me as to why doesnt it run the script.:( (7 Replies)
Discussion started by: abhi_123
7 Replies

10. UNIX for Dummies Questions & Answers

Crontab in script

I have crontab setup via crontab -e I was wondering if its possible to create a cron job from a script so when the script is run the cron job is created? (3 Replies)
Discussion started by: scriptnewbie
3 Replies
PPERL(1p)						User Contributed Perl Documentation						 PPERL(1p)

NAME
PPerl - Make perl scripts persistent in memory SYNOPSIS
$ pperl foo.pl DESCRIPTION
This program turns ordinary perl scripts into long running daemons, making subsequent executions extremely fast. It forks several processes for each script, allowing many processes to call the script at once. It works a lot like SpeedyCGI, but is written a little differently. I didn't use the SpeedyCGI codebase, because I couldn't get it to compile, and needed something ASAP. The easiest way to use this is to change your shebang line from: #!/usr/bin/perl -w To use pperl instead: #!/usr/bin/pperl -w WARNINGS
Like other persistent environments, this one has problems with things like BEGIN blocks, global variables, etc. So beware, and try checking the mod_perl guide at http://perl.apache.org/guide/ for lots of information that applies to many persistent perl environments. Parameters $ pperl <perl params> -- <pperl params> scriptname <script params> The perl params are sent to the perl binary the first time it is started up. See perlrun for details. The pperl params control how pperl works. Try -h for an overview. The script params are passed to the script on every invocation. The script also gets any current environment variables, the current working directory, and everything on STDIN. Killing In order to kill a currently running PPerl process, use: pperl -- -k <scriptname> You need to make sure the path to the script is the same as when it was invoked. Alternatively look for a .pid file for the script in your tmp directory, and kill (with SIGINT) the process with that PID. ENVIRONMENT
pperl uses the PPERL_TMP_PATH environment variable to determine the directory where to store the files used for inter-process communication. By default, the subdirectory .pperl of the user's home directory is used. BUGS
The process does not reload when the script or modules change. $^S is not represented identically with respect to perl, since your script will be run within an eval block AUTHOR
Matt Sergeant, matt@sergeant.org. Copyright 2001 MessageLabs Ltd. SEE ALSO
perl. perlrun. perl v5.14.2 2011-11-15 PPERL(1p)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy