The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Filesystem creation over existing Directory TheDoc AIX 0 04-03-2006 08:18 AM
creation of unwanted directory mridula High Level Programming 6 10-05-2005 11:40 AM
Mass directory creation? AeroEngy UNIX for Dummies Questions & Answers 6 07-21-2005 12:57 PM
directory creation sveera UNIX for Advanced & Expert Users 4 05-17-2005 01:06 PM
Remote directory creation srinivay UNIX for Advanced & Expert Users 5 11-05-2004 05:56 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-05-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Directory Creation problem

Hiiii,

here is my script--
Code:
BackupLocation="$OPTARG"
                if [[ $LFlag -eq 1 ]]; then
                        echo "Either option l or L should be given to $Programname"
                        echo "$Usage"
                        echo "$Programname is terminated"
                        return $ERR;
                fi
                if [[ $isBackUp -eq 1 ]];
                then
                        if [[ ! -d $BackupLocation ]];
                           then
                                echo "Non-existant directory specified"
                        fi
                               #givenPath="$BackupLocation"
                                BackupLocation=$BackupLocation/backup
                                mkdir -p $BackupLocation >/dev/null 2>&1
                                if [[ $? = 0 ]];
                                then
                                        echo "$Programname creates the dirctory $BackupLocation"
                                else
                                        echo "$Programname could not able to create the directory $BackupLocation"
                                        return $ERR
                                fi


                        lFlag=1
                        Llcron=l
                else
                        echo "$Programname is executed with -l option without action mtBackup"
                        echo "$Usage"
                        echo "$Programname is terminated"
                        return $ERR
                fi
                ;;
when i run this script through cronjob,then i am getting a directory creation problem.

supoose the directory name which i am giving is--

/home/namish
then my creates a directory called

/home/namish/backup

when i run it through cron then it again creates the directory backup inside backup directory.I can see my script is like that only but i want to modify this,can you please give me some valueable inputs so that this problem can be resolved.

The outcome should be when i run the script through cron it should not create the dir inside the backup di,instaed it should take backup onlyin the dir /home/namish/backup.If you need any moreclarification then please let me know.

Thanks..

Last edited by namishtiwari; 02-05-2008 at 05:04 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 02:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0