Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mjut

macrumors newbie
Original poster
Oct 16, 2008
2
0
Hi forum people,


this is my first post. I am, unfortunately, not a programmer but got to the place were I have been able to set up a backup-system in our small network.

It works absolutely fine - it connects to our server, mounts the backup-drive on the clients mac and does the syncing.

But - if the Server is not running, the script makes a directory in the /Volumes/ folder on the clients mac! How can I tell the script to STOP the script and not copying files onto the harddisk?

here is the script I am using:


---------------------------------------
set volumeName to "backup2" ---thats the backup-hd connected to the server ---
set serverAdresse to "192.168.220.46"
set userName to "username of my server"
set passwort to "servers pw"

try
do shell script "mkdir " & quoted form of ("/Volumes/" & volumeName)
end try

-- Server mount
try
do shell script "mount_afp " & quoted form of ("afp://" & userName & ":" & passwort & "@" & serverAdresse & "/" & volumeName & "/") & " " & quoted form of ("/Volumes/" & volumeName & "/")
on error errstr
--display dialog errstr
end try

-------------------------------------------
with timeout of 3600 seconds

do shell script "rsync -a /Users/stephan/Documents/ /Volumes/backup2/stephan/ || echo -n"

end timeout
-------------------------------------------

Thanks for looking at this!


-Stephan
 

kpua

macrumors 6502
Jul 25, 2006
294
0
Uh... delete this?

Code:
try
do shell script "mkdir " & quoted form of ("/Volumes/" & volumeName)
end try

"mkdir" means "make directory"
 

mjut

macrumors newbie
Original poster
Oct 16, 2008
2
0
Got it!

that mkdr-thing is do make that script run-able for OS 10.4 - there were som issues with that.
Now, i made a real simple version of that script:

Code:
---------------------------------------

mount volume "afp://user-name:pass-word@ip-adress/backup2"

-------------------------------------------
with timeout of 3600 seconds
	
	do shell script "rsync -a /Users/stephan/Documents/  /Volumes/backup2/stephan/ || echo -n"
	
end timeout
-------------------------------------------

it works well with 10.5 and - guess what - in 10.4 as well!
Thanks for the reply and sorry for bothering the forum with this. ;)

Sometimes "just talking about it" helps!

Cheers
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.