Storage synchronize data

From ICT science
Jump to navigation Jump to search

Windows: Robocopy

Robocopy is a command line data synchronisation utility included with Windows (no installs necessary). Example is about setting up sync to copy data from a local Windows system to betastor network storage. For a complete overview of all options visit https://ss64.com/nt/robocopy.html or type robocopy /? in the command line. Extensive use of options will require elevated access permissions. Start with the example if you're not an expert

setting up the robocopy synchronization

1. to start robocopy: click windows - start and type CMD

2. open Program CMD

3. adapt the example syntax to your specific situation

setup parameters
Source_folder|Destination_folder|solisID
option parameters
/E(copy all subfolders in tree) /XO(do not overwrite newer files) /V(verbose: show progress in terminal) /LOG+(write log data of sync to file)
general syntax
robocopy Source_path Destination_path [options]
example1: local folder to betastor network folder
robocopy "C:\Users\solisID\Documents\Source_folder" "\\soliscom.uu.nl\science\projects\projectName\users\solisID\Destination_folder" /E /XO /V /LOG+:"C:\Users\solisID\Documents\Source_folder\robosynclog.txt"
example2: U-drive network folder to betastor network folder
robocopy "\soliscom.uu.nl\uu\Users\solisID\My Documents\Source_folder" "\\soliscom.uu.nl\science\projects\projectName\users\solisID\Destination_folder" /E /XO /V /LOG+:"\soliscom.uu.nl\uu\Users\solisID\My Documents\Source_folder\robosynclog.txt"

remarks:

  • you may leave out the LOG+ option if the verbose option is enough for you
  • source path on your local system may be different, provided path applies to most UU-setups. Suggestion1: while constructing the path (in the command line window), you can use the TAB-key to complete partially typed folder- or filenames. Suggestion2: not sure about the next directory name? You can use the DIR command to get a directory listing
  • create a specific folder for both source and destination

4. run the the command to check for any errors. Make sure you have mounted betastor beforehand

5. copy the command line to notepad and save with a .cmd extension. You can now double-click the file to perform the sync. Sync will close automatically after finishing. You can check the result in: C:\Users\solisID\Documents\Source_folder\robosynclog.txt

MacOS/Unix: Rsync

Rsync is a command line data synchronisation utility included with Mac OSX/Unix (no installs necessary). Example is about setting up sync to copy data from a local system to betastor network storage. For a complete overview of all options visit https://ss64.com/osx/rsync.html or type rsync in the MacOS terminal. Extensive use of options will require elevated access permissions. Start with the example if you're not an expert

setting up rsync

1. to start rsync: open the Terminal app

2. adapt the example syntax to your specific situation

setup parameters
Source_folder|Destination_folder|solisID
option parameters
-r(recursive:also copy subdirectories) -l(don't follow symlinks) -p(preserve permissions) -t(preserve creation/modification times of files) -v(verbose: show progress in terminal) --stats(show transfer stats) --log-file(write log data of sync to file)
general syntax
rsync [options] Source_path Destination_path
example: local folder to betastor network folder
rsync -rlptv --stats --log-file=Documents/Source_folder/synclog.txt Documents/Source_folder /Volumes/projectName/users/solisID/Destination_folder
example: folder name includes space (replace space with "\ ")
rsync -rlptv --stats --log-file=Documents/Source\ folder/synclog.txt Documents/Source\ folder /Volumes/projectName/users/solisID/Destination\ folder

remarks:

  • you may leave out the log-file option if the verbose option is enough for you
  • source path on your local system may be different, provided path applies to the local Document folder under your own login. Suggestion1: while constructing the path (in the command line window), you can use the TAB-key to complete partially typed folder- or filenames. Suggestion2: not sure about the next directory name? You can use the ls -l command to get a directory listing
  • create a specific folder for both source and destination

4. run the the command to check for any errors. Make sure you have mounted betastor beforehand

5. copy the command line to TextEdit and add the following syntax. Save as plain text.

#!/bin/bash
rsync -rlptv --stats Documents/Source_folder /Volumes/projectName/users/solisID/Destination_folder

Note Make sure the Preferences for TextEdit are set correctly. Preferences > New Document > Plain text. Once set, relaunch TextEdit. Save file syncscript options: plain text encoding: UTF-8, deselect the default .txt extension (you can then skip step 6) Filename example: Syncscript (use any name you like), location: Source_folder

6. remove the .txt extension with Finder

7. Give the Syncscript file permission to run in the Terminall app.

sudo chmod 700 Documents/Source_folder/syncScript

Enter your system admin password.

8. You can now run the Syncscript by double-clicking the file