Link to home
Start Free TrialLog in
Avatar of skege
skege

asked on

Aix shell scripting

Hello!

This is my first post so please understand =)
First Sorry for my bad english..

I want to verify that my nfs mount is ok before i run the backup script. I tried next:

[code)

#!/bin/bash
#test

   if [ -a /mnt/backup/test.nfs ]; then
cp -R /data1/* /mnt/backup/data1
cp -R /data2/* /mnt/backup/data2
   else
       echo backup failed!
fi

[/code]

/mnt/backup/test.nfs is file that i create on nfs drive..
and the script checks if the file exist and if it exists script runs "backup".

That script work fine on the linux machine, but what do i must exchange to get that script work in IBM RS6000/AIX 4.3?

Hope somebody understand what i´am trying to say =)
Avatar of yuzh
yuzh

The script should behave the same way in AIX as in Linux, IF YOU have "bash" installed and the bash binary is in /bin at the AIX box.

do a:
ls /bin/bash to find out

otherwise, just change the script header to:
#!/bin/ksh

and keep the other statements unchange.
Avatar of skege

ASKER

yesh, sorry there is no bash in AIX box..
I test the script
Avatar of skege

ASKER

./backuptest[2]: [-a:  not found.
backup failed!

script returns something like that.
And I am sure that /mnt/backup/test.nfs file exists.
Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skege

ASKER

Thanks that works!

Normally i use rsync but i dont own these machines and i have no rights to install rsync :)

And i don`t use tar because customer wants use cp..don`t ask why.