Open MichaIng opened 6 years ago
@MichaIng
I've considered scrapping dietpi-sync, and upgrading dietpi-backup to support multiple source and target directories.
Its basically the same programs.
Only issue is with automated sync, and, supporting additional backup types + locations. Will take some time.
@Fourdee Jep, had the same idea, although thought the other way round, that a backup basically just a special sync 😆. Either way, makes sense to merge both 👍.
Further ideas about that:
DietPi-Sync
to allow adding multiple slots.DietPi-WiFiDB
, but (as I already plan to implement there), starting with only one or zero slots and allowing to add them via main menu option.The CLI could look like this:
dietpi-sync => Open main menu
dietpi-sync <slot_ID> => Open slot menu
dietpi-sync <slot_ID> 1/-1 => Sync/Recover slot by ID non-interactively
dietpi-sync all 1/-1 => Sync/Recover all slots non-interactively
dietpi-sync daily => Sync all slots with daily sync enabled non-interactively # Recover doesn't make sense here ;)
What needs to be though about, when allowing flexible amount of slots is:
/var/lib/dietpi/dietpi-sync/${FP_SOURCE_CURRENT//\//_}/custom_filter
. This could be used of course as well for other slot settings, even for skipping the settings arrays, but only use/source within a certain slot menu. But I think for performance and I/O reasons this should be kept in one file in RAMdisk. This also allows the daily cron to easier check whether dietpi-sync
needs to be started or not.
To implement DietPi-Backup
, we could hardcode a system slot, where one cannot edit the source dir or toggle delete mode.
dietpi-sync system 1/-1
echo -e '#!/bin/bash\n/DietPi/dietpi/dietpi-sync system "$@"' > /DietPi/dietpi/dietpi-backup
Actually I would again make userdata sync separate then, e.g. also as additional hardcoded slot. E.g. if one has Nextcloud data, music video and download folders in use and breaks the system, it is nearly no option to recover a backup, since new userdata, possible large downloads, Videos and critical Nextcloud shared data will be removed or overwritten with outdated ones. Userdata recovery most likely is used only, if not the system, but the userdata drive is broken.
Of course we could also make all of this to dietpi-backup
, since this is for sure the more used script. Only reason I thought about using dietpi-sync
, is that not all syncs are meant to be backups. Perhaps users use it to keep an external drive/stick with media for holidays up-to-date before doing vacation or music collection on their mobile phone and such. There the word "backup" simply does not fit very well, while every backup is just a sync with a special purpose 😉.
Why not make UrBackup Server a part of the install with a its Linux client. Well it's not as system resource friendly dietpi-backup but it's incredibly robust and reliable which is what you want with the backup system.
Creating a feature request:
Is your feature request related to a problem? Please describe:
Describe the solution you'd like:
Additional context: