Sponsored Content
Top Forums UNIX for Advanced & Expert Users "No such file or directory" while running crontab Post 302710829 by elango963 on Friday 5th of October 2012 02:45:22 AM
Old 10-05-2012
"No such file or directory" while running crontab

I am trying to take backup of server. while running manually, script working successfully.
while running in crontab its showing
Code:
"/bin/sh: /webMethod6/CustomMonitoring/scripts/backupWebMethodsCodeBase.sh: No such file or directory"
code forbackupWebMethodsCodeBase.sh

#!/bin/ksh

#Purpose : To backup webMethods Installation on a given server for quick 
#          restoration of  a corrupt server scenario 
#         Excludes un-necessary folders example SharedTempArea logs pipeline etc
#

set -a 

host=`/bin/hostname`
DateAsStr=` /bin/date  "+%m_%d_%Y"` 

echo "`date`  Backup of webMethods6 started on Host $host "  

if [[ $# -eq 1 ]] then
   BASE_DIR=$1

 if [[ ! -d $1 ]] then
  echo "Script $0 : Directory Doesn't exists. Valid webMethods Directory is required to proceed further.  Input $1. "
 exit 1
 fi 

else
 #default to webMethods6
 BASE_DIR="/webMethods6"

fi 

if [[ ! -d $BASE_DIR/custombackup ]] then 
 mkdir $BASE_DIR/custombackup 
else 
 #remove any old files 
 rm -f $BASE_DIR/custombackup/*.*
fi  

IS_DIR="$BASE_DIR/IntegrationServer"
onlyBaseName="`/usr/bin/basename $BASE_DIR`"
isroot_fileName="$BASE_DIR/custombackup/${onlyBaseName}_IS_${host}_$DateAsStr.tar.z"
webMroot_fileName="$BASE_DIR/custombackup/${onlyBaseName}_root_${host}_$DateAsStr.tar.z"

echo "`date` Tar webMethods6 Root folder as $webMroot_fileName  " 
cd $BASE_DIR

webMHomeList=`find . -maxdepth 1 -type d | grep -v wMbackupOld | grep -v WmPackagesTEST_20111202 | grep -v wMtest_bckup_20111202 | grep -v Ima
ge | grep -v Backup_20110702 | grep -v installer | grep -v custombackup | grep -v IntegrationServer | grep -v CustomMonitoring  | grep -v tspa
ceLocation | grep -v installer | grep -v install | grep -v tmp | grep -v configData | grep -v TNBackupData | grep -v lost | grep -v jvm  | tr 
-d '.' | tr -d '/' `

echo $webMHomeList 
nice tar -czf $webMroot_fileName $webMHomeList  

echo "`date` Tar webMethods6 IS Folder as  $isroot_fileName  "

cd $IS_DIR

webM_ISList=`find . -maxdepth 1 -type d | grep -v packages_2dec | grep -v DocumentStore_back | grep -v SharedTempArea | grep -v pipeline  | gr
ep -v logs | grep -v userFtpRoot | grep -v configData | grep -v TNBackupData |  tr -d '.' | tr -d '/' `

echo $webM_ISList 
nice tar -czf $isroot_fileName $webM_ISList  

echo "`date` Transfering $isroot_fileName "
. /webMethods6/CustomMonitoring/scripts/ftpToWindows1.sh  $isroot_fileName  $1

echo "`date` Transfering $webMroot_fileName "
. /webMethods6/CustomMonitoring/scripts/ftpToWindows1.sh  $webMroot_fileName $1

echo "`date`  Backup of webMethods6 completed "

Please Help me

Last edited by Scott; 10-05-2012 at 05:01 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

2. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

Crontab not running "nail" in script

the script is in Perl... this is one part of it: $command = "echo \"$text\" | /usr/bin/nail -s \"My $text1\" $ccstr$addstr"; system("$command") if length($bodytext)>1; crontab runs the script and sends me notifications but i cant receive any mail that i wanted! I'm using the complete path... (1 Reply)
Discussion started by: yeean
1 Replies

5. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

6. UNIX for Dummies Questions & Answers

Scripts exists but crontab says "File not found"

Hi All, We have an archiving script on our applications box. It is scheduled to run at 36th minute every hour. 36 * * * * /archive_7.sh But it throws an error saying "sh: /archive_7.sh: not found". I am not able to understand why. # ls -l /archive_7.sh ; file /archive_7.sh -rwxr-xr-x ... (4 Replies)
Discussion started by: satish51392111
4 Replies

7. Shell Programming and Scripting

Problem with running the "autorep" command via crontab

Hi, The user "MadeInGermany" tried to help on the below post by saying "This has been asked before; see the links below. Get your current LD_LIBRARY_PATH and redefine that in your ksh script! " Thanks for the help. but this did not help. And my post got locked. I can't reply on my previous... (5 Replies)
Discussion started by: girish1428
5 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
CRONTAB(1)						      General Commands Manual							CRONTAB(1)

NAME
crontab - maintain crontab files for individual users (V3) SYNOPSIS
crontab [ -u user ] file crontab [ -u user ] { -l | -r | -e } DESCRIPTION
Crontab is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var, they are not intended to be edited directly. If the allow file exists, then you must be listed therein in order to be allowed to use this command. If the allow file does not exist but the deny file does exist, then you must not be listed in the deny file in order to use this command. If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all users will be able to use this command. If the -u option is given, it specifies the name of the user whose crontab is to be tweaked. If this option is not given, crontab examines "your" crontab, i.e., the crontab of the person executing the command. Note that su(8) can confuse crontab and that if you are running inside of su(8) you should always use the -u option for safety's sake. The first form of this command is used to install a new crontab from some named file or standard input if the pseudo-filename ``-'' is given. The -l option causes the current crontab to be displayed on standard output. The -r option causes the current crontab to be removed. The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. After you exit from the editor, the modified crontab will be installed automatically. SEE ALSO
crontab(5), cron(8) FILES
/etc/cron.allow /etc/cron.deny STANDARDS
The crontab command conforms to IEEE Std1003.2-1992 (``POSIX''). This new command syntax differs from previous versions of Vixie Cron, as well as from the classic SVR3 syntax. DIAGNOSTICS
A fairly informative usage message appears if you run it with a bad command line. AUTHOR
Paul Vixie <paul@vix.com> 4th Berkeley Distribution 29 December 1993 CRONTAB(1)
All times are GMT -4. The time now is 05:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy