Windows robocopy based backup
create backup.cmd file with following content
Robocopy „C:\Pictures“ „N:\Backup\Pictures“ /FFT /MIR /COPY:DT /DCOPY:T /R:1 /W:1
Robocopy „C:\Musik“ „N:\Backup\Musik“ /FFT /MIR /COPY:DT /DCOPY:T /R:1 /W:1
source: own script developed in last years
Mac OS rsync based backup
rsync -rt --delete --progress ~/Documents/Picture /Volumes/NAS/backup/
used options in rsync
–delete most critical option, ensures deletion of files on destination, if destination have more files compared to source directory
–progress shows progress in the bash, quite informative if you want to see what’s going on during the backup
-r transverse all subdirectories contained within the source directory and copy the subdirectories and their content to the destination directory
-t preserve timestamps of source files
more information in source:Â https://blog.macsales.com/45185-mac-101-learn-the-power-of-rsync-for-backup-remote-archive-systems
How to create and run script on MAC without 3rd party apps
- start bash
- open the editor vi and learn to navigate with :i ESC :w :q :wq :q!
- enter the code
#! /bin/bash rsync -rt --delete --progress ~/Documents/Picture /Volumes/NAS/backup/
- Â run the script in bash
hostname:Documents user$ sh backuptest.sh
- or via double click but therefore you need (source)
chmod a+x backuptest.sh + associate the sh with Terminal.app
- or make it executable from Spotlight by
- rename from *.sh to *.command
-
set rights with chmod +x *.command