![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 05:04 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|