![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Filesystem creation over existing Directory | TheDoc | AIX | 0 | 04-03-2006 05:18 AM |
| creation of unwanted directory | mridula | High Level Programming | 6 | 10-05-2005 08:40 AM |
| Mass directory creation? | AeroEngy | UNIX for Dummies Questions & Answers | 6 | 07-21-2005 09:57 AM |
| directory creation | sveera | UNIX for Advanced & Expert Users | 4 | 05-17-2005 10:06 AM |
| Remote directory creation | srinivay | UNIX for Advanced & Expert Users | 5 | 11-05-2004 02:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
;;
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 02:04 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I tried to remove the -p option also,but still the problem exists.give me some suggestions experts.
Thanks |
|||
| Google The UNIX and Linux Forums |