image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
LinkBack Thread Tools
  #1  
Old March 5th, 2007, 07:39 AM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
d80h4g is on a distinguished road
Rsync over Samba issues

Hey, I have written a simple script for backing my macbook to a Samba share on my wireless LAN which I autorun using Crontab:

#!/bin/bash
mount_smbfs //bones@storage/Timbackup /Volumes/Timbackup
rsync -vaE --delete /Users/Bones/Documents /Volumes/Timbackup
rsync -vaE --delete --size-only --exclude "iPhoto Library" /Users/Bones/Pictures /Volumes/Timbackup
rsync -vaE --delete --size-only /Users/Bones/Music /Volumes/Timbackup
umount /Volumes/Timbackup

It works fine, but if my macbook is out of range of the LAN the samba share can't mount and the script copies all my data to the local folder /Volumes/Timbackup

This causes the macbook's hard disk to fill up. What I'd like to be able to do is get the script to check whether the share mounted successfully before copying the files.

Any suggestions?

Thanks in advance,

Tim
Reply With Quote
  #2  
Old March 25th, 2007, 08:16 AM
macbri's Avatar
Mac (r)evolution
 
Join Date: Jun 2005
Location: One of these days, Alice....
Posts: 298
Thanks: 3
Thanked 3 Times in 3 Posts
macbri has a spectacular aura aboutmacbri has a spectacular aura about
I know this is an older question, but if you're still interested in a solution:

You could check the exit status of the mount_smbfs command. Something like:

Code:
mount_smbfs //bones@storage/Timbackup /Volumes/Timbackup
if [ $? = 0 ];
then
    rsync -vaE --delete ... etc etc.  
    umount /Volumes/Timbackup
fi
Reply With Quote
  #3  
Old April 21st, 2007, 03:12 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
d80h4g is on a distinguished road
Thanks Macbri, that worked perfectly!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.