Thanks again for the help Vishal. I will get a NFS mount setup on the windows box. Thanks for the info on TAR. I will just zip them once they are moved.
In the script, this line specifically:
The four folders are in /data/, so by spacing them out, I did that correctly right? If I would want to add to them, I just space and then add another directory?
UNIX doesn't automagically understand \\servername\ style addresses. You have to mount that on your server somewhere. Unfortunately I'm not sure how to do this on Solaris.
Your for-loops are redundant. You can stuff all four folders into one find.
Putting find into backticks like that is dangerous and unnecessary. They call this a useless use of backticks.
-print is redundant when you have no other output options. find always prints, then.
Re-opening file_list with >>file_list every loop is redundant, just save it once and be done with it by putting the redirection outside the loop.
You're not doing any error-checking at all. It will delete the file even if it fails to copy it to the share!
Quote:
Also to confirm, do I save this as a .sh or .ksh ?
The computer doesn't care, only the #!/bin/ksh is important. The extension .ksh is just to tell programmers it's a ksh script and not some other kind of script when they see the filename.
Last edited by Corona688; 10-04-2011 at 03:00 PM..
Reason: niggling quotation mark
Your windows share doesn't appears correct, it has to be NFS mounted on your server, which I think needs some configuration on windows box, to enable NFS mounting of the share on Unix.
You can save it with any name you want, since we have specified which shell to use for executing [check the first line], but the best way to keep is .ksh as it will be executed on korn shell.
Regards,
Vishal
All you need is to configure simple shared folder on Win box and mount it as SMB/CIFS on Solaris server (mount process can be part of backup script). I'm sure that there is much more possibilities how to get it working (FTP, ssh/scp server for Win etc).
Not sure how you can trust in stability and reliability NFS with cooperation with Win, but better to avoid.
Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users.
In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Dear all,
I wonder if it is possible that we can run the script
from time to time..I meant, it should repeat the
sourcing of the script by itself? In my case, I need
to source this script manually from time to time,
like once in every 10 minutes.
emily, (2 Replies)
I have a script and I want the verbosity option to work in the following way:
User can either set quiet (no verbosity), use default verbosity level (when doing -v), or set a level value (when doing -v=2 or --vrbLevel=2).
I am making some more progress on this and am thinking of this idea.
... (4 Replies)
Hello all,
I know this must be simple .... but i can't grasp what could be the issue.
I'm trying to setup the timezone variable (to the unix command date) according to what i find in a value that i got from parsing the config file.
The end result would be setting the log file with this new... (4 Replies)
Hi,
I wrote two small scripts to set env variables in a shell.
java_env.csh
#!/bin/csh -fn
setenv JAVA_HOME '/scratch/software/jdk1.5.0_11'
setenv PATH $PATH':'$JAVA_HOME'/bin'
and run it using csh ./java_env.csh
But the env variables are not set. I tried running each line on the... (5 Replies)
Hi
i need to have a update for a file that updates only the last modified content from another file....
say for example....if file A is having content like
.
.
.
hatxxxx
catxxxx
ratxxxx
and file B(the file to be updated is having content as
hatxxxx
catxxxx
then file B has to be... (12 Replies)
Hi All,
I know to set global variable i can use export .. But take the situation like below ..
I want to set a variable in one script and access that in second script
i have done like this .. It is not working
one.sh
#!/usr/bin/ksh
echo $RISSHI
export RISSHI=1
two.sh... (3 Replies)
hi, am new to AIX.
i have an issue. iam asked to change the umask setting on a logon script on a server to prevent writable files. i logged in as the root user and typed in umask and it displays 022, which i believe is 755 for direc and 644 for files.
1) how to I identify where the logon script... (2 Replies)
HP-UX 11
I currently have a script that is running useradd and passwd commands to automate setting up new users. It was originally designed so that passwd was run with -d -f to delete a passwd and force user to set passwd at next login. Now mgmt wants instead to set a first-time passwd and have... (2 Replies)