I gang

BASH PROGRAMING!

I have a script that I wrote and I need it extended,

I need the script to compare a directory list to a user variable if the directory does not exist then it needs to be created.

Then the users remote directory gets mounted (there are multiple users)

then an rsync takes place.

Please notice how I create the directories daily by date!

Your job is to fix up this script, I got the script to compare usernames by the number of letters and thats wrong.

so i need a spot to enter the mount points as well and to get the script to compare and care directories.

my budget is $30

#!/bin/bash

users=( ysapir david rpril zrobinson )

emailadd=

hostname=`hostname`

directory=`date +%Y-%m-%d`

echo ${users[@]}

echo $directory

foonum=${#users}

count=0

for d in $( ls /backup/ ); do

echo ${d[@]}

for ((i=0;i<$foonum;i++)); do

if [ "${users[${i}]}" = "${d[@]}" ] ; then

echo ${users[${i}]} directory is synced

mount //[url removed, login to view] /mnt/${users[0]}/ -o username=ysapir,password=zublahzublah

rsync -av /mnt/ysapir/ /backup/${users[0]}/$directory | tee /tmp/[url removed, login to view]

cat /tmp/[url removed, login to view] | mail -s "$(date)"

cat /tmp/[url removed, login to view] >> /var/log/rsync/log

umount //[url removed, login to view]

let "count += 1"

fi

done

done

echo "COUNT: " . ${count}

echo "FOONUM: " . ${foonum}

if [ ${count} != ${foonum} ] ; then

echo Usernames are not synced, please verify variable.

else

echo Usernames are all synced.

fi

Færdigheder: Linux

Se mere: bash programing, bash programing echo, bash backup script, programing 1, o log n, job letters, how to programing, how to do programing, bash directory script, 192 168.1.1, login password bash programming, bash emailadd, bash comparing hostnames, bash script varlog, bash directory creator, bash script directory, bash 0, the tee, programing, mount, linux bash script, d bin, cat care, c++ programing, C# programing

Om arbejdsgiveren:
( 55 bedømmelser ) Gaithersburg, United States

Projekt-ID: #300096

Tildelt til:

nknk

Hi. That's my specialty. Please check PM.

$50 USD in 7 dage
(170 bedømmelser)
7.0

6 freelancers are bidding on average $33 for this job

Aserdp

Hi Please check PMB for details

$30 USD på 1 dag
(20 bedømmelser)
4.2
Arenabpo

Hello, it's easy, let me do it for you, Thank you!

$30 USD in 2 dage
(8 bedømmelser)
3.7
arikaterin

Hello, please see details in PM.

$30 USD på 1 dag
(7 bedømmelser)
3.1
amedina79

Hi, I can help with this matter, just contact me, Thanks

$30 USD in 2 dage
(0 bedømmelser)
0.0
idiotkid

Details in PMB.

$30 USD in 0 dage
(0 bedømmelser)
0.0