summaryrefslogtreecommitdiff
path: root/.config/nushell/remarkable.nu
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2026-08-29 19:57:46 +0200
committerWriterV2 <primary-v2@protonmail.com>2026-08-29 19:57:46 +0200
commit965513163a6776cbf22d60dbee1d97492b1f0a63 (patch)
tree0b062916470947302d86447f9e0ffbf99144035f /.config/nushell/remarkable.nu
parent411e2597a68de2955b5f760eadec4efcda426a8e (diff)
Nushell: Add `remarkable backup` command
Diffstat (limited to '.config/nushell/remarkable.nu')
-rw-r--r--.config/nushell/remarkable.nu17
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/nushell/remarkable.nu b/.config/nushell/remarkable.nu
index 8a5522c..2383ba6 100644
--- a/.config/nushell/remarkable.nu
+++ b/.config/nushell/remarkable.nu
@@ -16,3 +16,20 @@ export def download [collection_id?: string] {
download $in.ID
}
}
+
+export def backup [] {
+ let old_backup_path = $"($env.REMARKABLE_BACKUP_PATH)/RemarkableDocumentData/Old"
+ let current_backup_path = $"($env.REMARKABLE_BACKUP_PATH)/RemarkableDocumentData/CurrentBackup"
+
+ if (ls $current_backup_path | length) > 0 {
+ if (ls $old_backup_path | length) > 0 {
+ print "Deleting old backup..."
+ rm -r $"($old_backup_path)/*"
+ }
+ print "Moving current backup to old backup directory..."
+ mv $"($current_backup_path)/*" $old_backup_path
+ }
+ print "Backing up Remarkable document data..."
+
+ scp -r $"($env.REMARKABLE_SSH):/home/root/.local/share/remarkable/xochitl/*" $current_backup_path
+}