Linux shell script


We are looking for an experienced linux (debian) admin that can write logic below as a proper executable shell script.

The script should loop and copy files of a directory to newly created ones.

Then set file permissions, edit a line in a config file and add a crontab.

//shell script logic outline

start = '11001'

end = '10005'

inc ='1'

cronmin1 = 5

cronmin2 = 20

cronmin3 = 35

cronmin4 = 50

base_dir = '11000'

base_path = '/var/www/dcs'

//start loop from above defined start to end

for (i = $start; i <= $end; i = i + $inc){

//copy all files from base new directory

cp -r $base\_path/$base\_dir $base_path/$i

//change file permissions

chmod 666 '$base_path/$i/*.log

chmod 666 $base_path/$i/*.txt

//edit line in [url removed, login to view] to reflect correct port

sed 's/port = $base/port = $i/' $base_path/$i/[url removed, login to view]

//add crontab like this entry

$cronmin1,$cronmin2,$cronmin3,$cronmin4 \* * *| * $base_path/$i/[url removed, login to view] >/dev/null #Portcheck $i


Many thanks,


Skills: Linux, Script Install, Shell Script, Software Architecture

See more: php script null, add inc, in linux shell script, shell script, sh, linux config, install linux, dcs, loop script linux, write linux script, linux shell config file, shell add file, linux install script, write linux shell, file permissions, copy 270, php copy files directory, php script copy files directory, copy files directory directory, linux file edit, linux script log, shell file logic, linux shell script copy files, php copy chmod, copy files linux script

About the Employer:
( 65 reviews ) Philippines

Project ID: #2675462