Does anyone have a best practice for using Chronosync for DevonThink Pro backups?
I plan on using a thumb drive for the daily backups of rather small Devon files (less than 1GB) and then weekly copying the backups to a larger external drive.
Some of the forum articles appear to be years old. I thought it wise to check to see if anything has changed.
hi. what option are you using for package handling - standard or dissect?
there is some discussion on this board as to how dissect option does not work “well”. most of the users, appeared to try and synchronize using chronosync, but I am just trying to create a backup.
so I wonder why dissect should not work, other than for the fact that devonthink is likely open when chronosync backup is happening and that can cause issues, but that can cause issues even when backing up using the standard package handling option.
dissect can be much faster, for situations where say, only two documents have been added to devonthink, and the entire database (one of mine is 15GB+) needs to be copied for that reason (is using standard package handling option).
There is really nothing special/unique using Chronosync for DEVONthink Pro backups comparied to manually copying or other copy/sync programs. Just make the Source Target where DEVONthink puts the backups, and the Destination Target where you want your copies to go (I send to my ~/Backups/DEVON/Think folder on my Synology NAS). Operation should be “backup left to right”. I check “on” synchronize deletions. I schedule it for once a week, but you can do it more or less often.
there seems to be a choice between “dissect” where Chronosync presumably copies files that have changed inside the source devonthink package, vs “standard” where everything inside the the package is copied.
The 17gb backup, vs 5 files changed, is quite a difference, 5-6 minutes vs 30 min. So if I knew how to be safe about the “dissect” option, I can try and take those precautions. So for example, if Devonthink needs to be quit before the Chronosync backup is done, can do that by a pre-backup script.
But if quitting Devonthink is needed, for backup integrity to be maintained, then I presume it will be needed for “dissect” as well as “standard”.
@BLUEFROG do share your comments on backup integrity and how it relates to
the two options (dissect vs standard)
Devonthink left running and possibly causing changes on the drive while the backup is happening (in either mode - dissect or standard)
Yes, I have a scheduled AppleScript I picked up somewhere. Backups whatever database is open. I tend to have all the important databases open during the work-day. Scheduled via “cron” to run twice a week. See below.
My Primary is TimeMachine (supplemented with Backblaze offsite copy) which backup everything, including DEVONthink database packages and the zip files. Chronsync copies of zip are “icing on the cake”. Ensure that working before messing with secondary backups.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "DEVONthink 3"
set theDatabases to every database
show progress indicator "Running Backup" steps (count of theDatabases)
repeat with thisDatabase in theDatabases
set this_database to thisDatabase
step progress indicator (name of this_database as string)
set this_date to do shell script "date +%Y-%m-%d-%H-%M-%S"
set this_path to path of this_database
set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
set this_name to the last text item of this_path
set AppleScript's text item delimiters to ""
if this_name ends with ".dtBase2" then set this_name to (characters 1 thru -9 of this_name) as string
set this_archive to "~/SynologyMyDrive/MyDrive/backups/Backups DEVONthink/" & this_name & " " & this_date & ".dtBase2.zip"
set AppleScript's text item delimiters to od
with timeout of 1200 seconds
set thisMsg to "Verified: " & the name of thisDatabase & " with result "
set thisResultV to verify database this_database
set thisLog to log message (thisMsg & thisResultV & " errors and/or missing files")
if thisResultV = 0 then
set thisMsg to "Optimized: " & the name of thisDatabase & " with result "
set thisResultO to optimize database this_database
if not thisResultO then
set thisLog to log message (thisMsg & " Optimization of database failed.")
else
set thisLog to log message (thisMsg & " Optimization of database success.")
end if
if thisResultO then
set thisMsg to "Zipped: " & the name of thisDatabase & " with result "
set thisResultC to (compress database this_database to this_archive)
if not thisResultC then
set thisLog to log message (thisMsg & " zipped of database failed.")
else
set thisLog to log message (thisMsg & " zipped of database success.")
end if
end if
end if
end timeout
end repeat
hide progress indicator
display notification "DT backup finished."
end tell
@rmschne thank you for sharing the AppleScript. that looks good. I will set up the apple script to run once a day. and then once a day backup of my documents should meet the backup needs.
may be I should also use time machine, I do have a drive that I can connect directly to the MacBook. however, that means that every time I disconnect the computer from the hub, I need to first unmount the drive.
Because as of now, I do not have any USB drives connected to my MacBook, and when I need to take the MacBook somewhere, my muscle memory is simply to pull the USB cable out.
But, I need to start working on my muscle memory is what I hear from you. Will do. Thank you again for the replies!