Git Product home page Git Product logo

Comments (4)

davecan avatar davecan commented on June 24, 2024

Glad it can help!

No I haven't addressed backing up multiple collections. This script isn't strictly a generic backup script per se -- it is a wrapper intended to protect a single collection at a time by replacing using the SM exe or shortcut directly. Basically you configure the script to point to a single collection, then run the script instead and it will disable Dropbox, back up that one collection, launch it in SM, then when SM is closed it will restart Dropbox. If you want to protect multiple collections you should make a separate copy of the script & config file for each. Ideally I would have modified the script to accept the config file as a parameter, but the current solution is the simplest thing that could possibly work for solving this particular problem. (well maybe it could be simpler, but this is simple enough)

There is some interesting development happening on the SM Discord server. One of the members is working on a major enhancement to SM through an external utility/driver written in C# (to replace some of our AutoHotKey customizations) and has already built an alpha version of a generic backup utility that will run block-level shadow copies of any folder you specify, so it shouldn't be affected by Dropbox/etc at all. But it is 0.1 alpha so given the criticality of SM collections to each of us I'm personally using this script for the foreseeable future. Once the other is more mature I may switch. His app is called BitShelter and is available in this repo: https://github.com/alexis-/BitShelter

from safesupermemo.

rubisco57 avatar rubisco57 commented on June 24, 2024

Thank you for your answer and suggestion.
Alexis is doing amazing work! Unfortunately, BitShelter is not working on my system... for some reason :/
I will try to edit the script, in order to make it backup the collections in the same folder that are not in use - until then I will stick to your suggestion.

from safesupermemo.

davecan avatar davecan commented on June 24, 2024

Glad to help.

If you want you can come to the Discord and I'm sure he would help you troubleshoot it in realtime. He's great about supporting the community. I think this invite still works, it's the one posted on the SuperMemoPedia wiki: https://discord.gg/pB7jcSK

We have several hardcore members there from around the world who have been using SM for many years, including one who has become good friends with Piotr Wozniak himself. In the 2 months or so since it launched we've had thousands of messages flying, and compiled a set of best practices summarized in the SuperMemoLore doc (92 pages last I checked) hosted on the SuperMemo repo (unofficial repo created by Alexis) found here: https://github.com/supermemo/SupermemoLore

from safesupermemo.

LouisStAmour avatar LouisStAmour commented on June 24, 2024

Not sure if it helps anyone in particular, but I was looking for a quick way to create backups before launching SuperMemo and inspired by this repo's script I came up with a very short PowerShell script that gets the job done, backing up all the collections in my C:\SuperMemo\systems folder. It also stops running after launching SuperMemo, so I don't have an extra running process icon in my taskbar. As before, customize the first three variables to suit.

It uses robocopy to add retries to the file copy process but I've skipped the validation process which ideally would use hashes of the file contents to confirm files were copied as desired, it's just not that important to me if I've multiple copies of my backups already, though if there's an easy to use free tool for doing so, I'd consider swapping to it.

$collectionRootDir = "C:\SuperMemo\systems\"
$collectionName = "Louis Collection"
$backupRootDir = "C:\Users\louis\OneDrive\Documents\SuperMemo Backups\"

$backupName = (Get-Date).ToString("yyyyMMddTHHmmss") + " - " + $collectionName
$toDir = $backupRootDir + $backupName

robocopy $collectionRootDir $toDir /E /R:5 /W:5 /MT:8
$knoFilePath = $collectionRootDir + $collectionName + ".Kno"
Start-Process $knoFilePath -WorkingDirectory $collectionRootDir -PassThru

I don't feel the need to sync my collection over the internet yet, so I've dropped the sync killing feature. If I did need it, I'd probably try to sync a backup instead of the live SuperMemo directory. What I mean by this is I'd copy a backup to the cloud, then on the other computers, look for a more recent backup and copy it down before starting the app. This way the app is always running outside of the cloud sync sandbox, and the cloud sync is only used to upload backups after the app runs, and download backups before the app launches.

Theoretically, you could use the cloud to store app launch state -- like a lock file -- that way you could warn if the app was opened on multiple computers. If you saved the computer name to the lock file, you could tell yourself which computer had the app open, so you could go to it, presumably wake it from sleep, and close it. Or live with the data loss inherent from having a "split-brain" problem. Ideally there'd be a way to merge two collections by merging the actions done in both, as if replaying from a series of timestamps. But I haven't looked into things enough to know if there's such a replay log for state-modifying actions like that.

from safesupermemo.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.