Generate Luckybackup profile
GitHub: #675 BACKUP: Generate LuckyBackup profile from BackUp links
Goal
Generate LuckyBackup .profile files from Katalog's backup links to run rsync backup session without re-typing folders associations already defined in Katalog.
This page should faciliate the maintenance and alignment of the profile
Principles
- A Catalog is a device associated with a folder, to index the related list of files. This is the original indexed path (catalog_file_path) to be used as Source or Target (Destination in LuckyBackup).
- Active state handling, if source/target is not active (path unreachable): this does not matter to generate a profile, LuckyBackup checks active state before executing > always generate the profile.
- Multiple associations: create one profile with multiple tasks; 1 task per Katalog's backup link.
Profile definition
Profile naming:
- Name = "Katalog_" + timestamp
- Note for later (do not develop): Consider giving the profile name to overwrite it.
File locations: generated profiles shall be saved in default folder
~/.luckybackup/profiles/
Note: alternative (do not develop) could be Katalog collection folder or another user choice.
File type & name
The profile is a simlple text file, with a .profile extension
Profile path example
~/.luckybackup/profiles/Katalog_20251120085033.profile
Link & Task mapping definition
Katalog LuckyBackup
mapping_name → Task name
device_path (source) → Task source directory
device_path (target) → Task destination directory
mapping_type → Backup type (currently always "Backup" giving Type: "BackUp Source inside Destination")
Profile template
Created from an empty profile. 2 tasks created:
- Source=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_1 , Destination=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_1
- Source=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_2 , Destination=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_2
Consider that all these hereafter are required basic backup profile and tasks
List of fields & value to adjust:
- Name
- Source
- Destination
- Args
- Args
- LuckyBackupDir=/home/stephane/.luckyBackup/
LuckyBackupDir: replace stephane by the user name
***************************** WARNING *****************************
Do NOT edit this file directly, unless you REALLY know what you are doing !!
[profile_global]
appName=luckyBackup
appVersion=0.5
TotalTasks=2
[email]
emailCommand=
emailArguments=
emailSubject=luckyBackup report
emailNever=1
emailError=0
emailSchedule=0
emailTLS=0
emailFrom=
emailTo=
emailSMTP=
emailBody=Profile: %p
emailBody=Date: %d
emailBody=Time: %i
emailBody=Errors found: %e
[Task] - 0
Name=BackUpTask1
TypeDirContents=0
TypeDirName=1
TypeSync=0
Source=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_1
Destination=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_1/
LastExecutionTime=
LastExecutionErrors=-1
Args=-h
Args=--progress
Args=--stats
Args=-r
Args=-tgo
Args=-p
Args=-l
Args=-D
Args=--update
Args=--delete-after
Args=--filter=protect .luckybackup-snaphots/
Args=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_1
Args=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_1/
ConnectRestore=
KeepSnapshots=1
Exclude=0
ExcludeFromFile=0
ExcludeFile=
ExcludeTemp=0
ExcludeCache=0
ExcludeBackup=0
ExcludeMount=0
ExcludeLostFound=0
ExcludeSystem=0
ExcludeTrash=0
ExcludeGVFS=0
Include=0
IncludeFromFile=0
IncludeModeNormal=1
IncludeFile=
Remote=0
RemoteModule=0
RemoteDestination=1
RemoteSource=0
RemoteSSH=0
RemoteHost=
RemoteUser=
RemotePassword=
RemoteSSHPassword=
RemoteSSHPasswordStr=
RemoteSSHOptions=
RemoteSSHPort=0
OptionsUpdate=1
OptionsDelete=1
OptionsRecurse=1
OptionsOwnership=1
OptionsSymlinks=1
OptionsPermissions=1
OptionsDevices=1
OptionsCVS=0
OptionsHardLinks=0
OptionsFATntfs=0
OptionsSuper=0
OptionsNumericIDs=0
OptionsRestorent=0
OptionsVss=0
LuckyBackupDir=/home/stephane/.luckyBackup/
VshadowDir=/usr/bin
RsyncCommand=rsync
SshCommand=ssh
DosdevCommand=/usr/bin/dosdev.exe
CygpathCommand=/usr/bin/cygpath.exe
TempPath=/tmp
ByPassWarning=0
CloneWarning=1
RepeatOnFail=0
IncludeState=0
[Task_end] - 0
[Task] - 1
Name=BackUpTask2
TypeDirContents=0
TypeDirName=1
TypeSync=0
Source=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_2
Destination=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_2/
LastExecutionTime=
LastExecutionErrors=-1
Args=-h
Args=--progress
Args=--stats
Args=-r
Args=-tgo
Args=-p
Args=-l
Args=-D
Args=--update
Args=--delete-after
Args=--filter=protect .luckybackup-snaphots/
Args=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/source_folder_2
Args=/home/stephane/Developments/Katalog/Collections/TESTS/670_backup_mappings/target_folder_2/
ConnectRestore=
KeepSnapshots=1
Exclude=0
ExcludeFromFile=0
ExcludeFile=
ExcludeTemp=0
ExcludeCache=0
ExcludeBackup=0
ExcludeMount=0
ExcludeLostFound=0
ExcludeSystem=0
ExcludeTrash=0
ExcludeGVFS=0
Include=0
IncludeFromFile=0
IncludeModeNormal=1
IncludeFile=
Remote=0
RemoteModule=0
RemoteDestination=1
RemoteSource=0
RemoteSSH=0
RemoteHost=
RemoteUser=
RemotePassword=
RemoteSSHPassword=
RemoteSSHPasswordStr=
RemoteSSHOptions=
RemoteSSHPort=0
OptionsUpdate=1
OptionsDelete=1
OptionsRecurse=1
OptionsOwnership=1
OptionsSymlinks=1
OptionsPermissions=1
OptionsDevices=1
OptionsCVS=0
OptionsHardLinks=0
OptionsFATntfs=0
OptionsSuper=0
OptionsNumericIDs=0
OptionsRestorent=0
OptionsVss=0
LuckyBackupDir=/home/stephane/.luckyBackup/
VshadowDir=/usr/bin
RsyncCommand=rsync
SshCommand=ssh
DosdevCommand=/usr/bin/dosdev.exe
CygpathCommand=/usr/bin/cygpath.exe
TempPath=/tmp
ByPassWarning=0
CloneWarning=1
RepeatOnFail=0
IncludeState=0
[Task_end] - 1
[profile end]
Error handling
The only required part is the folder ~/.luckyBackup/profiles/
Create it if it does not exists.
No need to consider if LuckyBackup is installed or not.
UI implementation
Button and on clicked method:
void MainWindow::on_BackUp_pushButton_GenerateLuckyBackupProfile_clicked()
{
}