automating rsync

Joined
Aug 26, 2010
Messages
1
Reaction score
0
Points
1
hi,
I use my macbook on a lot of nets wifi and i've to backup some my folders to a samba server.
I'd like to use a simple rsync command (I tried it from the terminal and it's ok).
Now that's the problem: I should like to run automatically a script which do these two things:

connect to the samba server (I think I could do it with the mount command like "mount -t smbfs //usr:p[email protected]/backups /Users/myuser/directoryToMount")
execute the rsync command (only if the mount were ok)

making the script could be easy (saving the terminal instructions in a .sh file), but how can I automatically run the script where I connect to a wifi net with a specific ssid or, better, when I connect to wired ethernet?
I also would like to view a grow popup with the result of the operation (if it's a success or a fail)

sorry for my bad English!
Alberto
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
You can run all those shell commands in an Automator application that can be scheduled with iCal to run at certain times.

If you are using rsync from public location jut known that the traffic is not secure.

In Automator there are actions like get servers and connect to server as well as "run shell script".

Using an RSA key pair and the scp command would enable encryption. As would using SSH to tunnel your tasks from public locations.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top