user's manual
contents
luckyBackup is an application that backs-up and/or synchronizes any directories with the power of rsync. It is simple to use, fast (transfers over only changes made and not all data), safe (keeps your data safe by checking all declared directories before proceeding in any data manipulation ), reliable and fully customizable.
1. Backup Create a "clone"
of your data at another location in no time, safely. 2. Sync 3. Keep your data
safe 4. Simple / advanced
option 5. Exclude option 6. Only include
option 7. Add/remove any rsync
option 8. Remote
connections 9. Also execute 10. Restore
task 11. Simulation option 12.
Include option – Execution order The option to change the execution order of tasks is also given. 13. Profiles 14. Scheduling Scheduling for execution of already created profiles via cronjobs is supported. 15. Logfile 16. Command line
mode
Copyright
© 2008, Loukas Avgeriou
Before we proceed to any description or instructions, it would be useful to first make some definitions:
This is the application's main window as it appears as soon as you execute luckyBackup. It consists of :
...Playing around
Tasks Add Add a new task to the current profile.
Remove Remove an existing task from the current profile:
Modify Modify an existing task to your liking:
All profile related actions are accomplished via the toolbar:
or the menu → profile: Current Profile – profile load The profile you are currently using is displayed at the drop-down list, on the left of the toolbar. To change the current profile simple select another one from the list. The information window will display a message: Save To save the profile you are currently using, press the save button at the toolbar, or select profile → save from the menu, or press ctrl+S.
Default profile The default profile is the profile loaded as soon as luckyBackup starts. Normaly the name of the default profile is “default”. To change that, either press the default button at the toolbar or select profile → Default from the menu.
Rename To rename the profile you are currently using, press the rename button at the toolbar, or select profile → rename from the menu.
Delete To delete the profile you are currently using, press the delete button at the toolbar, or select profile → delete from the menu.
New Create a new profile:
Export You can export the current profile with the same or different file name at any location :
Note that you do not have to type the “.profile” extension. It will be added automatically. Also have in mind that the default directory where profiles are located is inside the user's home directory, under the folder “~/.luckyBackup/profiles”.
Import To Import a profile from another location:
Refresh To refresh the current view, simply click the refresh button, or select profile → refresh from the menu or press F5.
Create new, modify or remove existing luckyBackup schedules
Start the execution of all included tasks of the current profile. You have 2 options to do this: a. Normal execution. For real data transferring
b. simulation. Perform a dry-run execution of all included tasks of the current profile. If you are unsure of the effects on your data when executing an rsync command try the dry-run option. luckyBackup will perform a trial run that doesn't make any changes (and produces mostly the same output as a real run). Note: The progress-bar might be misleading when using this.
about Display the “about” dialog
Do not forget that this is free software. Help Display this manual
Language If you wish to change the language of the application:
In order to exit luckybackup:
Do
not worry about losing your profile if not saved when exiting the
application.
As already seen at a previous chapter the basic properties of a task are its name and its include state. Of course this specific task actually does something (e.g transfers data from the source to the destination). Although this might seems simple, a lot of parameters are involved in the way this can be accomplished. Let's have a deeper look at an task's properties by... creating a new task
As soon as you click the “add” task button the following dialog appears:
First thing you have to do is enter a name for this new task. Click on the “Task name” text field and type a name for the task. For example if you wish to backup the home directory of your sidux distribution, a good name would be “Back up my sidux home directory”. Actually, there is no such thing as a “good name”. Type anything that suits you best with no restrictions :-)
type The next thing you have to define is the task type. There are 3 types available: 1. backup the contents of the source directory Select this type to backup the contents of a directory, not the directory itself. In simple words, to copy over, all the data that the source contains inside the destination. 2. backup the entire source directory (by name) Select this type to backup a directory by name. This means that a new directory with the same name as the source will be created (if not already there) inside the destination. Example: Let's assume that you create a task and declare: source = /home/luckyb/photos/ (that contains a large number of files) destination = /media/backups/pictures/ If you select “backup dir contents” as task type, then all files and folders from inside /home/luckyb/photos/, will be copied inside /media/backups/pictures/. If you select ”backup dir by name”, then you will end up with the directory /media/backups/pictures/photos/ (the whole source directory will be copied inside the destination). 3. synchronize source & destination Use this task type in order to sync the source with the destination by keeping the most recent files at both of them. It can prove really useful if you modify specific files from different locations. Example: Let's assume that you are working on a project. You have created the directory /home/luckyb/project at your home PC and save all relevant files in there. At the same time there is a need to work on some of these files at another PC, so you copy them at your usb flash drive (location: /media/myUSB/project). There are times when you do not remember which file you edited when and from where. So you create a task declaring: source: /home/luckyb/project/ destination: /media/myUSB/project/ task type: “sync directories” This will result in a 2-way transfer. Newest modified files will be transfered from source to destination or the other way round. Also freshly created files at one of the locations will be copied over to the other. Please note that if you delete files at either the source or the destination and you perform this task, you will end up with these files created again because they still exist at the other location.
After defining the name and the type of the task, you have to define the source. That means the directory that holds the data that are going to be backed-up. You can do that in 2 ways: 1. Click on the “source” text field and type the full path of the source directory. For example /home/luckyb. 2. Click the “browse locally” button, located at the right of the source text entry field. A normal file dialog will appear. Navigate to the directory you wish to use as a source and press the “choose” button
Declare a directory to use as a destination, the same way as the source declaration procedure. This is the directory where the source will be backed-up to. For the “Backup my sidux home directory” example this could be /media/backups/siduxHome.
Below is a screenshot of the task properties dialog, with the name, source and destination fields, ready.
As soon as you are finished declaring all appropriate fields, click the “okay” button. If there are errors, you will be informed by the application.
If not, the main window will regain focus, displaying the task you just created. Note that the default include state of a freshly created task is FALSE (not included)
The task properties, as discussed at the previous chapter, are quite simple and straightforward. Now, it's time to have a much deeper look. If you haven't done it already (out of curiosity), do it now. Go ahead and press the advanced pushbutton at the “task properties” window. This will result in a resizing of the window and a display of much more information. It is not as complicated as it looks !!
This feature, allows the exclusion of certain file(s), folder(s), pattern(s) from the task. Everything declared here, will not be a part of the data transfer. It will be skipped. The Exclude tab is divided to 2:
1. Templates Use the checkboxes to exclude the following at will:
Example of an “Exclude” tab :
2. User defined You can declare anything you wish to be excluded from the task by adding it to the “exclude list” in the following way:
Remove an exclusion:
An exclusion can be a file, a directory or a list of files/directories that follows a pattern. Anything you add as an exclusion must follow the pattern rules, as described at the end of the chapter.
WARNING DO NOT FORGET TO EXCLUDE THE DESTINATION
It is possible sometimes, for the destination to be included in the source. Meaning that the destination directory is a part of the source hierarchy of files. examples: source is your root directory (“/”) and destination is /media/backups/ source is your home directory and destination is /home/username/backup/
This will result in unwanted data transfer. The destination will be backed-up onto itself !!
To avoid such circumstances, do not forget, to add as an exclusion the destination directory or a folder that contains the destination directory.
Use this feature, if you want to backup/sync specific file(s), folder(s) or pattern(s). For example, you might not want to backup a whole directory structure but just a single file ...or a single directory ...or 2 single files and all the open-office writer documents within this directory structure
Please note, that everything that you declare here, and only that, will be taken into consideration when performing data transfers of the specific task and nothing more.
Add You can declare anything you wish to only be included by the task, by adding it to the “only include list” in the following way:
Remove Remove an inclusion:
An inclusion can be a file, a directory or a list of files/directories that follows a pattern. Anything you add as an inclusion must follow the pattern rules, as described at the end of the chapter.
luckyBackup uses some default rsync options to perform tasks. That is not obligatory. You can remove any option and add others as you wish by using the Command Options tab. This is divided in 3 sections
backend This is not used
Templates Here, you will find normal checkboxes. These refer to some typical rsync options. Simply click a box to change its check state, so that to use or not the option(s) it refers to. The checkboxes provided and the relevant options they refer to are as follows:
User defined options Add You can add any rsync option you wish by adding it to the options list in the following way:
Remove Remove an option:
NOTE: Please refer to the man page of rsync for a complete reference of all possible options.
It is possible to use luckyBackup, not only for local transfers, but also for remote ones. Data transferring either to or from a remote host is possible. Tasks between 2 remote hosts is not supported.
To use this feature, simply check the box located on top of the Remote tab.
Source or Destination First, specify whether you want to use a remote host for your source or destination data by choosing an appropriate radio-button, located at the top of the options groupbox. Please note, that the directory located at the remote host and will be used by luckyBackup as source or as destination, still has to be declared at the appropriate text-edit fields, labeled source or destination accordingly, that are visible at “task properties - simple mode”. user Enter your username for the remote host at the user text-field.
host Enter the name of the remote host you would like to connect to, at the @Host text-field. Note that a host name can also be an ip address. host names examples:
remote module Connecting to an rsync module. If you are contacting an rsync daemon at the remote system directly via TCP, then check the Remote module box.
Some modules on the remote daemon may require authentication. luckyBackup, does not support either the definition of passwords as a task property (for security reasons), or the entry of passwords when prompted at the stage of a task execution (because it is possible for the specific task to be scheduled). If a password is required by the remote daemon, then you have to create a password file and declare it at the relevant text-field (use the browse button to open a graphical file dialog and select your already created file). The password file must not be world readable and it should contain just the password as a single line.
Please do not confuse the password to connect to an rsync module with the password needed if you use ssh as a transport shell.
ssh If you use ssh as a transport shell to connect to the remote host then check the ssh box.
As clearly stated above (at the remote module section): luckyBackup, does not support either the definition of passwords as a task property (for security reasons), or the entry of passwords when prompted at the stage of a task execution (because it is possible for the specific task to be scheduled).
For an ssh connection to become possible, you have to do all actions needed for a password-less connection, using an OpenSSH key pair.
However, if you still wish to use a direct password or protect your key with a passphrase, then you have to execute luckybackup from a terminal. Then, you will be prompted to enter your password/passphrase at that terminal and not via the gui.
Some helpful information on this ssh authentication scheme follows: The public key authentication scheme is based on public-key cryptography, using cryptosystems where encryption and decryption are done using separate keys, and it is unfeasible to derive the decryption key from the encryption key. The idea is that each user creates a public/private key pair for authentication purposes. The server knows the public key, and only the user knows the private key. ssh implements public key authentication protocol automatically, using either the RSA or DSA algorithms. The file ~/.ssh/authorized_keys lists the public keys that are permitted for logging in. When the user logs in, the ssh program tells the server which key pair it would like to use for authentication. The client proves that it has access to the private key and the server checks that the corresponding public key is authorized to accept the account. example: To create an appropriate public-private key pair, use the command $ ssh-keygen When prompted to enter a passphrase, just press “ENTER” twice (no passphrase). This stores the private key in ~/.ssh/identity (protocol 1), ~/.ssh/id_dsa (protocol 2 DSA), or ~/.ssh/id_rsa (protocol 2 RSA) and stores the public key in ~/.ssh/identity.pub (protocol 1), ~/.ssh/id_dsa.pub (protocol 2 DSA), or ~/.ssh/id_rsa.pub (protocol 2 RSA) in your home directory. Then copy the public key to ~/.ssh/authorized_keys in your home directory on the remote machine. The authorized_keys file corresponds to the conventional ~/.rhosts file, and has one key per line, though the lines can be very long. After this, you can log in without giving the password. Please refer to the man page of ssh for a complete reference of ssh connections.
Enter the full path of your private key file at the keyfile text-field (use the browse button to open a graphical file dialog if you wish).
Finally, specify the port to connect to, on the remote host, by entering its number at the port text-field. Leave it blank for the default ssh port (normally no.22).
This option is used for the situation that you wish to run some commands before and/or after the task execution.
Select the “before” or “after” section to add as many commands as you wish for pre or post task execution.
Validate The validate pushbutton can prove useful, if you wish to perform some initial checks to all the fields you have declared at the task properties window. As soon as you click the validate button, a pop-up message will apear, informing you of any errors or warnings found. In addition to this, it will display the actual command that is going to be executed.
Patterns entered in the “Task properties” window must follow these rules:
So, you have managed to create a number of tasks and you are ready to execute all or some of them.
Before doing so, you might want to review the following: Change the include state of any existing task
Have in mind that only included tasks will be executed. Also note that the include state is a basic property of a task, together with its name. Both these properties are saved inside a profile.
As soon as you “include” a task you will notice that there is an icon at the left of the task's name as well as some text displaying in the information window:
declared data check
A directories check will be performed instantly. All declared folders will be checked if they are empty or if they exist and luckyBackup will warn you accordingly. This task is performed to protect your data, either source or already made backups.
Please note that directory pairs statuses are divided into 3 categories: 1. ok: Both dirs are ok. You are ready to go as far as this pair is concerned.
2. WARNING: This task will be skipped to avoid doing something stupid with your data !! The declared source directory does not contain any data or does not exist at all. Most possible situation, is that you have forgotten to mount a partition or have just mistyped a path. You wouldn't like the foolish rsync command to make your already existent 500GB backup (that took 2 days to create), vanish in a second so as to look the same with an empty directory !!
3. CRITICAL: This task will NOT BE SKIPPED. The declared destination directory does not contain any data or does not exist at all. Most possible situation, is that you have forgotten to mount a partition or have just mistyped a path. Of course it might be the first time you perform the specific task, and you just want you destination folder to be created or fill with new data if it's empty. Beware if it's not the first time you perform this task. ADVICE: Spend some time and have a good look at this window. Then decide wisely whether to “Go on” and execute a bunch of rsync commands, or not and try to fix the errors that cause the “bad” status messages.
Tasks of a profile are executed sequentially, one by one at the order that they appear at the task list. You can change the execution order of the tasks within a profile:
Now is good time (actually, every time you change something regarding a profile is a good time) to save the profile you created.
After all this preparation you are ready to have a go. Well, just a final thought that might save you from a lot of trouble. That would be a...
simulation execution
If you are unsure of the effects on your data when executing an rsync command try the simulation option. luckyBackup will perform a trial run that doesn't make any changes (and produces mostly the same output as a real run). Note: The progress-bar might be misleading when using this.
Go on now. Click on that big purple button button that is clearly labeled: “start”.
task list check
For safety reasons, luckybackup will first check the task list for “errors” and pop up a relevant warning message if something is found unsatisfactory. For example if you haven't included any tasks, you will get a warning message at the information window.
The most important check of all is the one of many tasks that share the same destination. When luckyBackup performs a task the “normal” way (meaning, you were not tempted to click that “advanced” button and change stuff), you end up with a destination directory that is identical to the source. Any file that existed at the destination and did not at the source, will be deleted. Now imagine the situation of creating a number of tasks with different sources, the same destination (for example /media/backups) and “backup dir contents” as task type. The first task will execute ok resulting to a “cloned source” destination. The second task will clone the source again (which is different this time) to the same destination directory. This means the first task's backup will be lost. The second task will cancel the first. “backup dir by name” should have been selected as task type, so as to end up with the destination directory containing all the sources of your tasks as sub-folders. So do not be surprised if you face the following warning message as soon as you press the “start” button.
Well, you've done it. You wisely chose to “Start” at the main window and let the party begin. A new window fills with scrolling data calculating and transferring, messages and the progress-bar shows the progress of the current task (not in simulation mode):
Smash the “abort NOW” pushbutton any time during the execution of tasks if you feel like something is going wrong (or just want to see what will happen :-p).
All done As soon as all tasks are complete you will face the following window.
Please notice that a log file is created every time you come along this window. It is hosted in your home directory under ~/.luckyBackup/logs
The main goal of luckyBackup, as its name states, is the creation of backups of your data. Somebody once said: “ if you haven't backed up your data is like not having them at all !! ” That is because, based at the laws of probability, some time, for some reason, something will happen and you will lose valuable data. Another guy once said: “ computer users can be divided into 2 categories: Those that have lost data ...and those that have not lost data YET ”
I really wish you to never come to that situation. But if you do, then I hope that you backed up your data the very last minute either by using this application or not :-)
restore procedure The restore procedures that luckyBackup utilizes are actually normal tasks that are created from original ones with some crucial changes:
If you wish to create a restore task then proceed to the following:
Click ok to proceed.
NOTE: The original and the restore tasks are connected together. This has the following effects:
It is possible for luckyBackup to “make arrangements” for specific profiles to be executed at regular intervals automatically, without the need to run the gui of the application. If you wish to take advantage of that feature, click on the schedule button located at the toolbar of the main window
To add a new schedule, click the add button and define the following:
To modify an existing schedule:
Whenever you have finished adding, modifying, removing schedules click the cronIT pushbutton for the changes to take effect at your system.
luckyBackup uses the current user's crontab to schedule the execution of profiles. Please do not confuse that with the file /etc/crontab or anacron. If you wish to use these instead, you must manually alter relevant configuration files by adding lines that will execute luckyBackup in command-line mode using the “–no-questions” option. See the man pages of cron and crontab (1 & 5) for more details.
NOTE: If the /etc/cron.allow file exists, then you must be listed there in order to be allowed to use this feature. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/cron.deny file in order to use this feature. If neither of these files exist, then depending on system-dependent configuration parameters, only the super user, or all users will be able to use this feature. For standard Debian systems, all users may use this feature. Some useful (terminal/console) commands:
NOTE 2: luckyBackup saves all the information of the “schedule dialog” at its own configuration file every time you click the cronIT button. That is irrelevant with the system's crontab and has the following effects:
The output of execution of scheduled profiles is saved in the following log file located at your home directory: ~/.luckyBackup/logs/cronLogfile.txt
For those of you that for any reason would like to execute luckyBackup without a graphical user interface (gui), it is possible to run it in... command-line mode
You first have to have an already created profile using the gui. Then, by using the terminal/console, just type the command: luckybackup [options] [profile filename]
[options] can be :
[profile filename] is the already created profile that is going to be executed
examples: 1. Execute luckybackup in command-line mode for profile '~/.luckyBackup/profiles/BackupHome.profile' : $ luckybackup -c ~/.luckyBackup/profiles/BackupHome.profile
2. Execute luckybackup in command-line mode for profile '~/.luckyBackup/profiles/BackupHome.profile' : Do not ask any questions and skip all tasks that appear CRITICAL after the checks $ luckybackup --skip-critical --no-questions ~/.luckyBackup/profiles/BackupHome.profile
Command-line mode can be quite useful at systems where a graphical desktop is not available as well as for executing luckyBackup by calling it from another process/application (e.g. anacron).
EpilogueWish you good, fast, reliable, safe and usable backups (no matter if you use luckyBackup or not) luckyb :-)
|