Jump to content

Have an idea and need help with Automator


Keith1974
 Share

2 posts in this topic

Recommended Posts

I use my work Mac and work from an external hard drive. Trouble is I go to meetings and leave it in my Mac monitor so don't have access to the files when I need them.

 

I use the hard drive as I can take that home and work and leave the work Mac there.

 

Is there a way I could change this process? I am thinking of working from the Mac hard drive so as not to worry about the external drive when going to meetings. Anyway...

 

I was wondering if there was a way that I could work on files on my Mac but when the external hard drive is connected have certain folders and files auto update?

 

It's kind of like time machine but concentrated on certain folders I work on. I've been trying to find a way to have Automator do this for me but cannot find it.

 

Any ideas?

Link to comment
Share on other sites

You can use something like rsync to keep the files in both locations up to date/identical put that syncing in a bash script and have cron run the script at the interval you specify, there you have it poor man's time machine without the wasted space. Something like this for the bash script.

#!/bin/bash
 
# Check if directory exists if so rsync the folder(s)
if [ -d "/Volumes/Path/To/External/Storage/Directory" ] then ;
     rsync -a "/Volumes/Path/To/Internal/Storage/Directory" "/Volumes/Path/To/External/Storage/"
else
     exit 0
fi

Then a crontab -e in Terminal to add new entry to run at the interval you wish pointing to the script to run. Do not forget to chmod +x script.sh to make it executable. If you have more than one directory to sync then add another line for each one or if under a common directory as subdirectories then only the top level directory needs to be synced as it will/can do all under that. The first part of the rsync line is the source so needs to include the directory you want synced the second part the destination since it is syncing the directory it does not need to be included in the path only its top level directory needs to be there.

 

Edit: Sample of an hourly crontab job to be run.

@hourly      /path/to/script/to/start.sh
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...