Rosetta_Backup.sh - Back Up to USB
(redirected from Main.REBBackup)
Rosetta’s Key Programs: Overview · Rosetta_Launch.sh · Rosetta_Settings.sh · Rosetta_Backup.sh · Rosetta_Update.sh · Rosetta_Change_Network.sh · Rosetta_Install_Debian_13_Trixie.sh
Purpose
Rosetta_Backup.sh starts Back Up to USB, a small window that copies the operator's own files onto a USB memory stick: the settings, G-code programs, custom HAL file and tool table. Everything else can be reinstalled from GitHub, so these are the files that matter if the Raspberry Pi's SD card fails.
The same program has a Restore from USB window, which copies a backup back onto the Raspberry Pi. It is only started from Rosetta Settings' File menu - see Restore from USB below.
How it is run
- The Backup Rosetta desktop icon, and Applications > Rosetta > Backup Rosetta.
- Rosetta Settings' File menu > Back Up to USB...
- From a terminal:
|
/home/reuben/linuxcnc/configs/Rosetta/Rosetta_Backup.sh |
Parameters
None.
Using it
- Insert a USB stick. It appears in the window within a couple of seconds (one opened before the stick goes in is fine).
- Choose the stick if more than one is shown, and click Back Up.
- Wait for Safe to remove before pulling the stick out. The stick has been ejected: to use it again (another backup, a restore), pull it out and plug it back in.
What it copies
| From the Raspberry Pi | To the stick |
| /home/reuben/Documents/*.ini (RosettaSet_v1.ini and saved or exported settings) | Documents/ |
| /home/reuben/linuxcnc/configs/Rosetta/gcode/ (all files and subfolders) | gcode/ |
| .../Rosetta/Rosetta_Custom/Rosetta_Custom.hal and Rosetta_Tool.tbl | Rosetta_Custom/ |
| /home/reuben/linuxcnc/nc_files/ (all files and subfolders; links to LinuxCNC's own examples are skipped) | nc_files/ |
A folder missing on this machine is skipped and noted in the log. The list is BACKUP_SOURCES at the top of Rosetta_Display/Rosetta_Backup.py.
Files it creates
On the stick, a new folder every time - an earlier backup is never overwritten:
|
Rosetta_Backup/YYYY-MM-DD_HHMM/ |
backup_log.txt lists every file copied and anything that failed. Nothing is written on the Raspberry Pi itself.
Restore from USB
Started from Rosetta Settings' File menu > Restore from USB... (window RestoreWindow in Rosetta_Display/Rosetta_Backup.py).
- Choose the stick, then the backup - the dated folders under Rosetta_Backup/ on the stick, newest first. Older backups made before the renaming (in REB_Backup/) are listed too; their old names (REBset_v1.ini, REB_Custom/REB_Custom.hal, REB_Custom/REB_Tool.tbl) are restored under the new ones.
- The window says how many files of each kind the backup holds, and, in red, any difference between the backup's machine setup and this one's - which role is on each channel, and whether the expansion box is connected. This is a warning only.
- Restore asks for confirmation (Cancel is the default), then copies each file in the backup back to the folder it came from (the table above).
- The stick is ejected, and Rosetta Settings closes without saving.
Rules:
- It refuses to start while LinuxCNC is running - LinuxCNC saves RosettaSet_v1.ini as it closes, which would undo the restore.
- Every file it replaces is first copied to /home/reuben/Documents/Before_Restore/YYYY-MM-DD_HHMM/, laid out like a backup. To undo a restore, copy those files back.
- Files on the Raspberry Pi that aren't in the backup are left alone - nothing is deleted.
- Each file is written beside the old one and then renamed over it, so a failed copy never leaves a half-written file.
- Rosetta Settings closes afterwards so it can't save the values it had loaded over the restored settings file. If it had unsaved tuning changes, it asks about them before the restore starts.
Programs it calls
| Program | What for |
| Rosetta_Display/Rosetta_Backup.py | The program itself (Python 3, GTK 3). |
| pgrep | Checks whether LinuxCNC is running. |
| udisksctl | Unmounts and powers off the stick when the backup or restore is finished. |
It finds the stick by reading /proc/mounts for the desktop's automount folders (/media/... or /run/media/...).
Notes for support
- Stick not seen: it must be mounted by the desktop - check it opens in the file manager. Only drives mounted under /media or /run/media count, so the SD card and network drives never appear.
- Back up with no program cutting. If LinuxCNC is running the window warns but still allows it: heavy USB copying can disturb the realtime motion timing.
- Restoring: use Restore from USB (above). To bring back only the settings from a saved copy, Rosetta Settings' Load Settings also works.
- Stick missing after a backup or restore: it was ejected. Pull it out and plug it back in.
- The Raspberry Pi's whole SD card is not backed up - a failed card is replaced by reinstalling (Rosetta_Install_Debian_13_Trixie.sh) and then copying these files back.
- Not to be confused with an older Rosetta_Backup.sh (deleted 6 August 2026) that backed up a RoseEngineButlerLocal folder.
|
eMail comments to |
