Find Jobs
Hire Freelancers

BASH PROGRAMING!

$30-250 USD

Completed
Posted over 15 years ago

$30-250 USD

Paid on delivery
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 //[login to view URL] /mnt/${users[0]}/ -o username=ysapir,password=zublahzublah rsync -av /mnt/ysapir/ /backup/${users[0]}/$directory | tee /tmp/[login to view URL] cat /tmp/[login to view URL] | mail -s "$(date)" cat /tmp/[login to view URL] >> /var/log/rsync/log umount //[login to view URL] 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
Project ID: 300096

About the project

6 proposals
Remote project
Active 16 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi. That's my specialty. Please check PM.
$50 USD in 7 days
4.9 (170 reviews)
7.0
7.0
6 freelancers are bidding on average $33 USD for this job
User Avatar
Hi Please check PMB for details
$30 USD in 1 day
4.9 (20 reviews)
4.2
4.2
User Avatar
Hello, it's easy, let me do it for you, Thank you!
$30 USD in 2 days
3.3 (8 reviews)
3.7
3.7
User Avatar
Hello, please see details in PM.
$30 USD in 1 day
5.0 (7 reviews)
3.1
3.1
User Avatar
Hi, I can help with this matter, just contact me, Thanks
$30 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Details in PMB.
$30 USD in 0 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Gaithersburg, United States
5.0
55
Payment method verified
Member since Sep 10, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.