I use Automator for a few things, and I really love it, but this one I can't quite seem to wrap my brain around, mostly because I don't know any of the programming language, and even when I can figure that out I can't quite figure out what to tell it as far as the destination.
There's a fairly complex back story here, which I'm trying to avoid so that I can just get this issue resolved and see how it goes. I'm happy to get into the nitty gritty, but first I just want to solve this issue, so I'll try to be succinct:
I need to backup a folder on my iMac's desktop titled Live Work to our Synology NAS. I want to create an Automator workflow that's attached to said folder so that anytime said folder is altered the workflow runs and the corresponding folder on the server (called Live Work Sync) is altered accordingly.
I have a couple of issues:
1. I have multiple directories on the server, and I can't figure out how to use Get Specified Servers and Connect to Servers to not only log me in but always select Live Work Sync (the idea being here that if my wife makes a change I don't want to hear about how annoying it is that the iMac keeps prompting her for this and that). So, if I'm pointing Get Specified Servers to afp://10.0.3.5, do I instead say afp://10.0.3.5/Live Work Sync? I still have the login/credential issue
2. I think the only other issue is that I'm not quite sure what code to use when I use Run Shell Script. So far, with my reading and research this afternoon, I think I need the following:
rsync -av --force --delete ~/
The problem is I'm not exactly sure how to (a) tell it, in code, to pick [the entire contents of] Live Work on the desktop, and (b) I sure as heck don't know how to tell it to then also pick Live Work Sync on the DiskStation as the target destination and ensure that whatever exists (and only whatever exists) on the iMac's Live Work folder must therefore exist in the target folder.
Does this make sense? I feel like it's an easy thing if you know the code, but alas I don't (at least not yet, anyway). I feel pretty stupid for not being able to at least figure out question #1.
Last edited by mister_g60; 03-30-2012 at 03:11 PM.
To make it simple, you have a folder that you want sync'd any time it changes,
So, basically, you need a script that can detect changes to the folder, and if
there are any, run rsync. Correct?
rsync leverages ssh. You can get around the username/password auth bit
by sharing keys between the appropriate servers. Do you know how to do that?
As for "Live Work Sync" I have no idea what that is, neither do I know anything
about Automater, though I'm guessing the later is a fancy name for cron.
Do you know what a cron job is?
Yes, that's right, you've got it. I hadn't thought of SSH, though at this moment I don't think I know how to utilize it. (Give me a few research hours and some Google and I can probably figure it out.)