Linux copy script
I am trying to make a script to copy drivers in linux but I don't know the commands, much less how to copy files to a "c:" drive in linux.
I was using it in dos, but for certain reasons, this will not work for us. Here is a section of the script I am currently using in Dos:
[code]
REM The correct Drivers.
mkdir c:\drivers
set MODEL=%#*"SELECT REPLACE(prod_name,' ','_') FROM computer WHERE computer_id=%ID%"%
pause
goto %MODEL%
:latitude_C400
xcopy p:\Drivers\Dell\C400\*.* c:\drivers\ /S /e /c /y
GOTO END
[/code]
the P: drive is already mapped in linux as \mnt\prod\, so I can convert some of it, and I am guessing i will have to use a lot of if/else statements instead of goto commands.
Any help is much appriciated.
EDIT:
would firm copy replace xcopy? I have a script writen by HIIS that uses firm copy so instead of:
xcopy p:\Drivers\Dell\C400\*.* c:\drivers\ /S /e /c /y
would it be:
firm copy /mnt/prod/drivers/dell/C400/*.* prod:/drivers/*.*
?? I am not sure if it will allow me to use a *.* though.
Here's what I have
Haven't used this in a while, but here's a snipping from the script I have:
firm -recurse Copy "/mnt/images/Deploy/Drivers/D620" "prod:/Drivers" > /dev/tty1
As for the if/else statements - use CASE. Functionally the same thing, just easier to add to the script down the road.
Hope this helps,
Brad
Use Firm
Firm would allow you to directly copy files to the OS Production partition.
A snippet of my script is:
/mnt/ds/rdeploy/linux/firm -recurse copy /mnt/drv/170l prod:\drivers
The above command assumes the following:
1. That you are using Linux Automation
2. That you have a mount point in Linux where your drivers are located
So, in essence, in the situation where the above line is being run, it is for a Dell Optiplex 170L and is copying the drivers folder from the 170L folder that is on a server and is mounted to /mnt/drv. The -recurse switch tells it to take all subfolders when copying and the "prod:\drivers" tells it to copy the files/folders to "c:\drivers"
Below is my full script:
Above
Just a clarification in the code in my last post. The reason why it appears that some of the models are duplicated is because Linux is CaSe SeNsItIvE and the equipment manufacturers aren't always consistent in how they report the model name. Some are capitalized and some are not.
I tried this with our flavor
I tried this with our flavor of Linux and it didn't seem to work. I (and perhaps others) may need to adjust some of the caps and direct paths for other languages. ex: \WINDOWS
C400
I noticed you are working with a C400. I have never had a lot of real luck with the C-series laptops. The only real way I was able to get the drivers to copy on the older model laptops was to do the copy via DOS and use the firm command in DOS. The image itself can be deployed using Linux though (which is some consolation as Linux is about 1000% faster than DOS when it comes to imaging).
If you are using an HII image between all of your platforms (old and new), you can create "conditions" on your tasks that make the task use specific scripts or automation OS's based on hardware platform.
Hope this helps.
Would you like to reply?
Login or Register to post your comment.