luckyBackup logo





v.0.3.3 user's manual

please be a bit patient for a complete manual update



contents

name

source

destination

type

exclude

only include

options

remote

also execute

validate

pattern rules

include state

declared data check

execution order

save profile

simulation

task list check

add

modify

remove

cronIT

crontab info

log-file



go up
overview – features

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.

Backup any directory (source) to another (destination).

luckyBackup copies over only the changes you've made to the source directory and nothing more.
You will be surprised when your huge source is backed up in seconds (after the first time !!).

Whatever changes you make to the source including adding, moving, deleting, modifying files / directories etc, will have the same effect to the destination.

Owner, group, time stamps, links and permissions of files are preserved (unless stated otherwise).

2. Sync
Sync any directories keeping the files that were most recently modified on both of them.

Useful if you modify files on more than one PCs (using a flash-drive and don't want to bother remembering what did you use last.

3. Keep your data safe
luckyBackup first checks whether the directories you've declared exist or if they are empty and warns you accordingly.

You wouldn't want your 500GB music collection backup (that took half a day to create !!) vanish in a second if you forgot to mount the external drive that your source is in !!
You also wouldn't want to execute an rsync command if your destination folder is in an external drive that you also forgot to mount.

4. Simple / advanced option
The add/modify task dialog is quite simple and everybody can use it with confidence.
Hit on the "advanced" pushbutton at the task properties window and a whole bunch of other options will appear.
If you know what you're doing change anything at will.

5. Exclude option
Exclude any file, folder or pattern from the transfer.
You might not want to copy over backup files (*~), trash folders, system mount folders (/media & /mnt), some huge video files or anything else.

6. Only include option
Use this option to only transfer over specific file(s), folder(s) or pattern(s) within your source directory and nothing else.

7. Add/remove any rsync option
If you don't like the default rsync options that luckybackup uses, add or remove any option you wish.

8. Remote connections
Remote connections are possible, either for use as a source or as a destination.

9. Also execute
You can execute any command(s) before or after a specific task.

10. Restore task
Everybody wishes to never use this !!
But when this time comes, luckyBackup gives you the option to create an task based on an existing one for restore purposes.

11. Simulation option
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.

12. Include option – Execution order
A separate check-box can be used to include or not a task within a profile.

The option to change the execution order of tasks is also given.

13. Profiles
You don't have to create all tasks from scratch every time you start luckyBackup. You can save your preferences in a .profile file and load it whenever needed. Use as many profiles as you like.

14. Scheduling

Scheduling for execution of already created profiles via cronjobs is supported.

15. Logfile
After all tasks execution, a logfile is created in your home folder. You can have a look at it any time you want.

16. Command line mode
luckyBackup can run in command line if you wish not to use the gui, but you have to first create the profile that is going to be executed.
Type "luckybackup --help" at a terminal to see usage and supported options.








legal

Copyright © 2008, Loukas Avgeriou

luckyBackup is distributed under the terms of the GNU General Public License.

It is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.




definitions



Before we proceed to any description or instructions, it would be useful to first make some definitions:



task

For example the task of backing up one directory to another. The basic properties of a task are:

a. Its name (for example “backup my home directory”).

b. Its include state which actually says if the task will be executed or not.

source

The directory that holds the data to be backed-up.

destination

The directory that source will be backed-up to.

profile

A collection of tasks at a particular order.

schedule

A profile that is scheduled to be executed at a specific time, at a specific day.

super-user mode

The execution of luckyBackup with super-user privileges.

Command-line mode

The execution of luckyBackup without a graphical user interface (gui), by using a terminal.






the main window







This is the application's main window as it appears as soon as you execute luckyBackup.

It consists of :

  • A menu.

  • A toolbar that refers to current profile handling.

  • The Task List which lists all the available tasks of the current profile.

  • 3 buttons that refer to specific task handling (addremovemodify).

  • A start button and a simulation check-box. You can start the execution of all the tasks included in a profile by using these.

  • An information window.

  • An exit button. Pressing this, will quit luckyBackup.



...Playing around





Tasks

Add

Add a new task to the current profile.

  • Press the add button for the add task dialog to appear.

Remove

Remove an existing task from the current profile:

  • Click on an task name, inside the task list, to highlight it.

  • Press the remove button.

  • Answer yes to the dialog that will appear to permanently remove the task.

Modify

Modify an existing task to your liking:

  • Click on an task name, inside the task list, to highlight it.

  • Press the modify button for the modify task dialog to appear.



Profiles

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:

  • Press the “new profile” button or select “Profile → new” from the menu or press ctrl+N.

  • Enter the name of the new profile at the dialog that will appear and press ok.





Export

You can export the current profile with the same or different file name at any location :

  • Select “Profile → export” from the menu.

  • The following dialog will appear

  • Type a file-name for your profile or select an already existent profile to replace it.

  • Press the save button

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:

  • Select “Profile → import” from the menu.

  • The following dialog will appear.

  • Select the profile you wish to import.

  • Click the open button to finish the procedure.



Refresh

To refresh the current view, simply click the refresh button, or select profile → refresh from the menu or press F5.



Schedule

Create new, modify or remove existing luckyBackup schedules

  • Click the schedule button at the toolbar or select profile → schedule from the menu, for the schedule dialog to appear



Start

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

  • Click the “start” button.

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.

  • Check the “simulationcheck-box to enable this option.

  • Click the “start” button

Help

about

Display the “about” dialog

  • Select “Help → about” from the menu.





Do not forget that this is free software.

Help

Display this manual

  • Select Help → Help from the menu or

  • Press F1.



Language

If you wish to change the language of the application:

  • Select Settings → Language from the menu

  • Click on the language you wish to use



Quit

In order to exit luckybackup:

  • Click the EXIT button, located at the bottom right corner of the main window or

  • Select Profile → Quit from the menu or

  • Press ctrl+X

Do not worry about losing your profile if not saved when exiting the application.
You will be prompted accordingly.










task properties (the simple way)



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:





name

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.



source

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



destination

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)














task properties (for the unsatisfied)



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 !!



Exclude

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:

  • Temp folders.

    All folders named tmp. These are directories that are used for storing temporary data that you would not mind losing. For example /tmp.

    pattern used: **/*tmp*/

  • cache folders.

    All folders named cache. These folders are used by various application or systems for storing cache data. Your browser for example, uses a cache folder.

    pattern used: **/*cache*/ & **/*Cache*/

  • backup files.

    Backup files created by various applications. These are files whose filenames have a trailing “~. For example if you open the text file “LotsOfText.txt” for editing, make changes and save it, then apart from the main file, another one will be created named “LotsOfText.txt~”. This is identical to the pre-modified “LotsOfText.txt” and is created automatically for backup/safety purposes.

    pattern used: **~

  • mount directories.

    System normal mount points. These would be /media and /mnt. If you decide to use your “/directory as source, then it would by wise to check this for various reasons. The most important one is to avoid backing up the destination onto its self!! Usually, the destination is a hard disk partition, different from the one that your distro is installed and your root directory (“/”) is located. This will be normally mounted at point /media or /mnt.

    Please see the WARNING at the end of this chapter.

    patterns used: /mnt/*/** & /media/*/**

  • lost+found.

    System folders named lost+found.

    pattern used: **/lost+found*/

  • system folders.

    These would be /var, /proc, /dev and /sys. Again, you can use this option if you decide to backup your root folder (“/). If it does not suit you and you want your own defined directories to be excluded, feel free to leave this unchecked and use the “user defined” way to declare anything.

    patterns used: /var/**, /proc/** , /dev/** & /sys/**

  • Trash.

    Directories named trash. These are directories where files that you delete are stored.

    patterns used: **/*trash*/ & **/*Trash*/



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:

  1. Use the text field located next to the add button to enter what is going to be excluded. If you find it handy, use the browse locally button, located at the right of the text field, to open a graphical file dialog.

  2. Press the add button (or ENTER), to add the entered text to the exclude list.



Remove an exclusion:

  • click on it to highlight it

  • click the remove button.



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.





Only Include

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:

  1. Use the text field located next to the add button to enter what is going to be included. If you find it handy, use the browse locally button, located at the right of the text field, to open a graphical file dialog.

  2. Press the add button (or press ENTER), to add the entered text to the “only include” list.



Remove

Remove an inclusion:

  1. Click on it to highlight it

  2. Click the remove button.







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.





Options

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:

  • Skip newer destination files refers to:

    -u, --update

This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different.)
Note that this does not affect the copying of symlinks or other special files. Also, a difference of file format between the sender and receiver is always considered to be important enough for an update, no matter what date is on the objects. In other words, if the source has a directory where the destination has a file, the transfer would occur regardless of the timestamp.
  • Delete files on the destination refers to:

    --delete
This tells rsync to delete extraneous files from the destination side (ones that aren't on the source side), but only for the directories that are being synchronized. You must have asked rsync to send the whole directory (e.g. “dir” or “dir/”) without using a wildcard for the directory's contents (e.g. “dir/*”) since the wildcard is expanded by the shell and rsync thus gets a request to transfer individual files, not the files' parent directory.
Files that are excluded from the transfer are NOT excluded from being deleted because of the automatic use of the --delete-excluded option.
This option can be dangerous if used incorrectly! It is a very good idea to first try a run using the --dry-run option (-n) to see what files are going to be deleted.
If the sending side (source) detects any I/O errors, then the deletion of any files at the destination will be automatically disabled. This is to prevent temporary filesystem failures (such as NFS errors) on the sending side causing a massive deletion of files on the destination. You can override this with the --ignore-errors option.
    --delete-after
Request that the file-deletions on the destination be done after the transfer has completed. This is useful if you are sending new per-directory merge files as a part of the transfer and you want their exclusions to take effect for the delete phase of the current transfer. It also forces rsync to use the old, non-incremental recursion algorithm that requires rsync to scan all the files in the transfer into memory at once (see –recursive).
    --delete-excluded
In addition to deleting the files on the receiving side that are not on the sending side, this tells rsync to also delete any files on the receiving side that are excluded.
This option is added only if the “exclude groupbox” is activated.


  • Recurse into directories refers to:

    -r, --recursive
This tells rsync to copy directories recursively.
Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed. This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer. It is also only possible when both ends of the transfer are at least version 3.0.0.
Some options require rsync to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and --delay-updates.
Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias.
  • Preserve ownership, times refers to:

    -o, --owner
This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user (see also the --super and --fake-super options at the rsync man page). Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side.
The preservation of ownership will associate matching names by default, but may fall back to using the ID number in some circumstances.
    -g, --group
This option causes rsync to set the group of the destination file to be the same as the source file. If the receiving program is not running as the super-user (or if --no-super was specified), only groups that the invoking user on the receiving side is a member of will be preserved. Without this option, the group is set to the default group of the invoking user on the receiving side.
The preservation of group information will associate matching names by default, but may fall back to using the ID number in some circumstances.
    -t, --times
This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing -t will cause the next transfer to behave as if it used -I, causing all files to be updated (though rsync's delta-transfer algorithm will make the update fairly efficient if the files haven't actually changed, you're much better off using -t).
  • Preserve permissions refers to:

    -p, --perms
This option causes the receiving rsync to set the destination permissions to be the same as the source permissions.
When this option is off, permissions are set as follows:
o
Existing files (including updated files) retain their existing permissions, though the --executability option might change just the execute permission for the file.
o
New files get their “normal” permission bits set to the source file's permissions masked with the receiving directory's default permissions (either the receiving process's umask, or the permissions specified via the destination directory's default ACL), and their special permission bits disabled except in the case where a new directory inherits a setgid bit from its parent directory.
Thus, when --perms and --executability are both disabled, rsync's behavior is the same as that of other file-copy utilities, such as cp and tar.
In summary: to give destination files (both old and new) the source permissions, use --perms.


  • Preserve symlinks refers to:

    -l, --links
When symlinks are encountered, recreate the symlink on the destination.
  • Preserve device, special files refers to:

    -D
The -D option is equivalent to --devicesspecials.
--devices
This option causes rsync to transfer character and block device files to the remote system to recreate these devices. This option has no effect if the receiving rsync is not run as the super-user.
    --specials
This option causes rsync to transfer special files such as named sockets and fifos.
  • Preserve hard links refers to:

    -H, --hard-links
This tells rsync to look for hard-linked files in the transfer and link together the corresponding files on the receiving side. Without this option, hard-linked files in the transfer are treated as though they were separate files.
When you are updating a non-empty destination, this option only ensures that files that are hard-linked together on the source are hard-linked together on the destination. It does NOT currently endeavor to break already existing hard links on the destination that do not exist between the source files. Note, however, that if one or more extra-linked files have content changes, they will become unlinked when updated (assuming you are not using the --inplace option).
Note that rsync can only detect hard links between files that are inside the transfer set. If rsync updates a file that has extra hard-link connections to files outside the transfer, that linkage will be broken. If you are tempted to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes happen due to lingering hard links (and see the --inplace option for more caveats).
If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy. This does not affect the accuracy of the transfer, just its efficiency. One way to avoid this is to disable incremental recursion using the --no-inc-recursive option.
  • Ignore files the CVS way refers to:

    -C, --cvs-exclude
This is a useful shorthand for excluding a broad range of files that you often don't want to transfer between systems. It uses a similar algorithm to CVS to determine if a file should be ignored.
The exclude list is initialized to exclude the following items (these initial items are marked as perishable — see the FILTER RULES section):
RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .bzr/
then, files listed in a $HOME/.cvsignore are added to the list and any files listed in the CVSIGNORE environment variable (all cvsignore names are delimited by whitespace).
Finally, any file is ignored if it is in the same directory as a .cvsignore file and matches one of the patterns listed therein. Unlike rsync's filter/exclude files, these patterns are split on whitespace. See the cvs(1) manual for more information.
If you're combining -C with your own --filter rules, you should note that these CVS excludes are appended at the end of your own rules, regardless of where the -C was placed on the command-line. This makes them a lower priority than any rules you specified explicitly. If you want to control where these CVS excludes get inserted into your filter rules, you should omit the -C as a command-line option and use a combination of --filter=:C and --filter=-C (either on your command-line or by putting the “:C” and “-C” rules into a filter file with your other rules). The first option turns on the per-directory scanning for the .cvsignore file. The second option does a one-time import of the CVS excludes mentioned above



User defined options

Add

You can add any rsync option you wish by adding it to the options list in the following way:

  1. Use the text field located next to the add button to enter the option you would like to add.

    Type the option, starting with a “-” or a “--” (without the quotes), followed by the appropriate string. Do not enter spaces.

    Example: “ --xattrs

  2. Press the add button (or press ENTER), to add the entered option to the “options” list.





Remove

Remove an option:

  1. Click on it to highlight it

  2. Click the remove button.







NOTE: Please refer to the man page of rsync for a complete reference of all possible options.



Remote

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:

  • freehosting.net

  • 89.70.191.201



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).









Also Execute

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.





Pattern rules

Patterns entered in the “Task properties” window must follow these rules:



  • if the pattern starts with a /
    then it is anchored to a particular spot in the hierarchy of files, otherwise it is matched against the end of the pathname. This is similar to a leading ^ in regular expressions.
    Thus “/foo” would match a name of “foo” at the “root of the transfer(that would be the source).
    An unqualified “foo” would match a name of “foo” anywhere in the tree because the algorithm is applied recursively from the top down; it behaves as if each path component gets a turn at being the end of the filename. Even the unanchored “sub/foo” would match at any point in the hierarchy where a “foo” was found within a directory named “sub”.
  • if the pattern ends with a /
    then it will only match a directory, not a regular file, symlink, or device.
  • choosing between doing a simple string match and wildcard matching is done by checking if the pattern contains one of these three wildcard characters: ‘*’, ‘?’, and ‘[’.
  • *
    matches any non-empty path component (it stops at slashes).
  • **
    matches anything, including slashes.
  • ?
    matches any character except a slash (/).
  • [
    introduces a character class, such as [a-z] or [[:alpha:]].
  • in a wildcard pattern, a backslash can be used to escape a wildcard character, but it is matched literally when no wildcards are present.
  • if the pattern contains a / (not counting a trailing /) or a “**
    then it is matched against the full pathname, including any leading directories. If the pattern doesn't contain a / or a “**”, then it is matched only against the final component of the filename. (Remember that the algorithm is applied recursively so “full filename” can actually be any portion of a path from the starting directory on down.)
  • trailing “dir_name/***
    matches both the directory (as if “dir_name/” had been specified) and everything in the directory (as if “dir_name/**” had been specified). You need rsync version 2.6 or later for this option.














not just ready yet



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:

Include state

Change the include state of any existing task

  • Just click on an include checkbox, at the left of an task's name to change its state to included (checked) or not included (unchecked)

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.



Execution order

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:

  • Click on an task to highlight it.

  • Press the up/down arrow keys located at the right of the “Task List” to change its position inside the list.



Save profile

Now is good time (actually, every time you change something regarding a profile is a good time) to save the profile you created.

  • Click on the “save” button or select “Profile → save” from the menu or just press ctrl+S .












use the big purple pushbutton

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.

  • Check the “simulationcheck-box to enable this option.



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.




















(r)sync IT baby



Well, you've done it. You wisely chose to Startat 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 NOWpushbutton 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










restore

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:

  • The task name is changed so that it is distinguished from the original.

  • A swap between the source and the destination is performed so that the destination becomes the source and the other way round.

  • The “skip newer destination files” box, at the “options” groupbox of the modify task widow, is unchecked so that every file of the backup replaces the one that exists at the original data.



If you wish to create a restore task then proceed to the following:

  1. At the application's main window, click on a task to highlight it and then click the modify pushbutton.

  2. At the “task properties” window that will appear, check the box Also create a task for restore purposes and click “Okay”.

  3. You will face the following message box:



    Click ok to proceed.

  1. Another “task properties” window will appear. This is the restore task and it differs from the original at the 3 points just stated (name, source & destination, “skip newer files” option).

  2. Change anything at your will (or just leave it as it is) and click the “Okay” button to create the RESTORE task.

  3. Execute the RESTORE task as usual to restore your data at its original place.



NOTE: The original and the restore tasks are connected together. This has the following effects:

  • You will get warning messages when you try to modify or delete one of them.

  • You cannot create more than one restore tasks from one original task.












cron IT

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



add

To add a new schedule, click the add button and define the following:

  1. Profile declaration

    Select an already existent profile from the Profile list.

  2. Skip critical

    As described earlier, before the actual execution of tasks, luckyBackup first checks all declared data for errors and produces relevant messages. Those, that appear with a WARNING message are skipped anyway to protect your data. But those with a CRITICAL message, although suspect, are not going to be skipped. If you wish the latter to be skipped at schedules then check the skip critical box.

    The default and advised state of this check-box is checked (meaning skip all tasks that appear with a critical message).

    Please refer to chapter ”use the big purple button – declared data check” for more information about messages.

  3. Execute every

    It is possible to schedule a specific profile to execute at a specific time, at specific intervals by declaring the following:

  • Month & day of month

    Declare the specific date you wish your profile to be executed, by selecting the relevant month & day of month (for example every February the 26th).

    If you do not wish to use this option leave both listboxes to Any.

  • Day of week

    Choose the day of week, you wish your profile to be executed (for example every Sunday). If you do not wish to use this option leave it to Any.

    NOTE: If you use both “Month & day of month” and “Day of Week” then the profile will be executed when at least one of them matches the relevant time criteria. For example if you declare “every February the 26th “ as well as “every Sunday”, the schedule will run every Sunday and every February 26th.

    TIP: If you wish the schedule to run every day, leave all 3 fields to Any.

  • Time

    Declare the specific time at which you want a profile to be executed by entering appropriate data at the hour & minute boxes. Use the up/down arrows if you find them handy. e.g. for execution at time 17:45, enter hour:17 & minute:45.

  1. add

    To finish the procedure of adding a new schedule, click the okay pushbutton.

    A new line will appear at the window above “Profile execution details”, stating the profile you have chosen and when this is scheduled for execution.

modify

To modify an existing schedule:

  1. Select a schedule at the window, so that it is highlighted and click the modify button.

  2. Change everything at your will and click the okay button when you're finished.





remove



  1. Click on a schedule at the window to highlight it.

  2. Click the remove pushbutton.



cronIT

Whenever you have finished adding, modifying, removing schedules click the cronIT pushbutton for the changes to take effect at your system.



crontab info

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:

  • crontab -l

    causes the current crontab to be displayed on standard output.

  • crontab -r

    causes the current crontab to be removed.



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:

  • luckyBackup does not interfere with other (if any) entries of your crontab. It just adds/changes/removes its own entries without affecting anything.

  • If you alter or remove your crontab manually and accidentally delete luckyBackup entries, you can still open the “schedule dialog” (all the information will appear) and click “cronIT” for the deleted entries to recover.

  • If you wish to delete all luckyBackup entries from your crontab, open the “schedule dialog”, “remove” everything and click “cronIT”.



log-file

The output of execution of scheduled profiles is saved in the following log file located at your home directory:

~/.luckyBackup/logs/cronLogfile.txt








terminal lovers



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 :



--help

Display a “usage” help message

-c

Console mode

Execute luckyBackup in command-line mode

--no-questions

Execute luckyBackup in command-line mode and skip confirmation questions asked to user

--skip-critical

Execute luckyBackup in command-line mode and skip tasks that appear with a 'CRITICAL' warning message after the data check

--dry-run

Execute luckyBackup in command-line mode, in dry-run (simulation) mode







[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).










Epilogue

Wish you good, fast, reliable, safe and usable backups

(no matter if you use luckyBackup or not)

luckyb :-)