aboutsummaryrefslogtreecommitdiff
path: root/_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md
diff options
context:
space:
mode:
authorBradley Taunt <brad@serpapi.com>2024-06-13 14:57:38 -0400
committerBradley Taunt <brad@serpapi.com>2024-06-13 14:57:38 -0400
commit26c7db12364e8eba08e2f8e85bb534ed735a0be8 (patch)
tree0e1d2f6e2456ca2266993eef72881057ee5b3dd9 /_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md
parenta134c38317e808d6535af990cc505dab1bc7bbfe (diff)
Major overhaul and cleanups
Diffstat (limited to '_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md')
-rw-r--r--_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md18
1 files changed, 12 insertions, 6 deletions
diff --git a/_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md b/_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md
index e8836e6..d736012 100644
--- a/_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md
+++ b/_posts/2024-02-16-Website_Backups_with_Apple_iCloud.md
@@ -7,19 +7,25 @@ My main work machine, an M2 MacBook Air, meshes really well with my iPhone SE (t
Recently I've been using iCloud as my "middle-man" backup system. I still have local, offline storage for most personal data but having additional off-site backups is never a bad thing. I make things easier for myself by taking advantage of `rsync`. You'll need to make sure you have that program installed before trying this yourself:
- # This assumes you have homebrew installed first
- brew install rsync
+```sh
+# This assumes you have homebrew installed first
+brew install rsync
+```
Then, whenever I feel like backing up an existing project or website I simply run:
- rsync -a user_name@ssh.webserver.domain:/home/var/www/ /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Backups/site-backup
+```sh
+rsync -a user_name@ssh.webserver.domain:/home/var/www/ /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Backups/site-backup
+```
> Note: The `-a` option tells `rsync` to sync directories recursively, transfer special and block devices, preserve symbolic links, modification times, groups, ownership, and permissions.
The beautiful magic of `rsync`! Obviously, you'd want to properly name your directories (ie. `/Backups/site-backup`) for a cleaner structure and ensure that your iCloud directory is set correctly. (remember to read code before just copy-pasting!). With this approach you can backup entire server directories or be specific with each individual project folder. I would also recommend setting up some alias in your `.bashrc` or `.zshrc` etc. to make things more streamlined when running backups manually:
- alias site-backup="rsync -a user_name@ssh.webserver.domain:/home/var/www/ /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Backups/site-backup"
- # Then you simply run the following for a manual backup:
- site-backup
+```sh
+alias site-backup="rsync -a user_name@ssh.webserver.domain:/home/var/www/ /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Backups/site-backup"
+# Then you simply run the following for a manual backup:
+site-backup
+```
You can take this further by automating things via cron jobs, but for my use case that is a little overkill. Hopefully this helps anyone looking for a quick and dirty backup system, especially one that can piggyback of your existing iCloud that you might be paying for already.