rSync commandline bash script

Joined
Mar 19, 2015
Messages
1
Reaction score
0
Points
1
Hi,

Wonder if anyone can assist. I have been a mac user for some time and previously a ubuntu linux user familiar with commandline and creating the odd script to run repetitive commands.

I have been using my mac for sometime now and have vital files in one folder on my mac. I also have NAS on my home network and a share available for me to back my files up to.

Using an command line application like rSync I would like to backup the contents of a particular folder (and sub directories) from lets say its "~/Pictures” to network share which lets say "/Volumes/Nas/Picarchive”. Is anyone able to help me with a command that will do this incrementally, only backing up file names.
Any advice is appreciated
Scar1
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Take a look here to help you construct the rsync command of your choosing.

Are you looking to have this run on a schedule as well? If so, you'll want to leverage something like cron or launchd (the latter of which is OS X's scheduling system, the former being much simpler and the Linux nerd in me is supportive of that option). If this is something you want to do, let us know and we can help with that.
 
Joined
Jul 2, 2007
Messages
3,494
Reaction score
204
Points
63
Location
Going Galt...
Your Mac's Specs
MacBookAir5,2:10.13.6-iMac18,3:10.13.6-iPhone9,3:11.4.1
Here's a simple one I use to keep folders synced up via cron every 10 minutes:

0,10,20,30,40,50 * * * * rsync -av /source/path/. /dest/path/. >> /place/for/logfile.log &
 

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