Project Detail

BASH PROGRAMING!  

BASH PROGRAMING! is project number 300096
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: nknk

Budget: $30-250

Created: 08/13/2008 at 12:05 EDT

Bid Count: 6

Average Bid:
$ 33

08/16/2008 at 12:05 EDT

Project Creator: urzevel
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (14 reviews)

Bid On This Project
 

Description

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 //192.168.1.11/MyDocuments/Backup /mnt/${users[0]}/ -o username=ysapir,password=zublahzublah
rsync -av /mnt/ysapir/ /backup/${users[0]}/$directory | tee /tmp/rsync.log

cat /tmp/rsync.log | mail -s "$(date)"

cat /tmp/rsync.log >> /var/log/rsync/log

umount //192.168.1.11/MyDocuments/Backup

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

Messages Posted:0 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

 

50

7 days

08-13-2008 13:04 EDT

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

help

 

30

2 days

08-13-2008 13:14 EDT

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

help

 

30

1 day

08-13-2008 15:30 EDT

Hi Please check PMB for details

help

 

30

1 day

08-14-2008 01:41 EDT

Hello, please see details in PM.

help

 

30

2 days

08-13-2008 14:23 EDT

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

help

 

30

0 days

08-13-2008 19:13 EDT

Details in PMB.

help


    Bid on this Project