I have never use a shell script.. I would like to use this one...
How do I set this up? Thanks.
I have never use a shell script.. I would like to use this one...
How do I set this up? Thanks.
A script is simply a list of instructions that you may type at the keyboard, but put in a file with a very simple header ( "#!/bin/sh" ). They are then made executable using "chmod +x script-name".
These are normally stored in a well choosen directory and are run by type their pathname at the shell prompt. They can also be executed by other agents such as cron, or at startup/shutdown.
A commonly used naming convention is they have the shell type as an extension, eg *.sh, *.ksh, *.csh etc.
Hmm.. So I should copy and paste the code from the thread above into a text editor... Upload that file to /bin.. then call that file?
There is no need to put the script on the bin directory.
copy the text into a text file adding in the first line #!/bin/sh (or whatever your shell is)
chmod +x filename.sh ( makes the text file executable
then you can add the directory where the file is located to the user path, if you want.
if you saved the file on /root then you can run it with:
/root/filename.sh <--- press enter
voil�
Nope... I made the file and upload but when I type in "/root/fileame" I get command not found. How do I know what shell I'm using?
echo $SHELL will tell which shell are you using.
It would be very helpful if you copy the text you are trying to run as a script, maybe the problem is inside the text (like running a command that doesn't exist).
Oops.. I just noticed the link I posted earlier was wrong. I'm trying to use the script found in this thread:
My shell is bash. Does that mean I need to change the first line in the script?
Perderabo wrote that script in ksh, an it uses constructs that are only availbale in ksh. You will not be able to "just switch to using bash", it would need quite a bit of work for to be it working.
Bummer... I have a really large site(40GB) that I need to transfer from server to server. Any suggestions?
What OS is it, what login mechanisms are available, and can you install additional software?
linux
Login Mechanisms? Plesk?
Yes.. It's a (dv) from mediatemple.net (Virtual Dedicated Server)
From the local server
scp -r /directory_to_copy user@remote_server:/remote_directory
will work if you have ssh on both servers and a firewall between them is not filtering port 22.
-r means recusive
man scp will help a lot.
Like ssh, ftp etc. Are you able to login, or do you have Plesk access only?
I have root access
Excellent, What type of linux is it (output from the "uname -a" command )
Linux 2.6.9-023stabl044.4-enterprise
try running:
up2date -i ksh
command not found
how about:
yum install ksh