PYBAG User manual

Contents

  1. Contents
  2. License
  3. About
  4. Installation
  5. Requirements
  6. Quick start with GUI
  7. Quick start with CLI
  8. PYBAG alphabet
  9. Grafical interface
    1. Main window
    2. Menu
    3. Toolbar
    4. Files list
    5. Preferences dialog.
    6. Add root dialogs
    7. Remove root dialog
    8. Distribute dialog
    9. Relocate dialog
    10. Properties dialog
    11. Statistic dialog
  10. Commands and options
    1.  Commands
    2. Common options
  11. Common information
    1. Directory structure
    2. Data base file
    3. Configuration file

License

Copyright (c) 2007 .. 2010, Mazhugin Aleksey

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Mazhugin Aleksey nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

PYBAG - Crossplatform files synchronization and backup portable tools.

This program implements portable bag and is intended for fast synchronization and backup.
It let's you use a portable digital storage devace to carry your electronic documents similar to the way you can use a bag to carry paper documents.

You can synchronize the bag with your original files easily. If a synchronization conflict occurs, it will be reported. You can specify rules for automatic conflict resolution.

With PYBAG, you can backup files and synchronize any changes made to the original files with the bag. The synchronization process will only copy changed files.

The program is cross-platform and independent from the OS and filesystem. You may easily synchronize files between Windows and Linux, for example. Symbolic links are supported on all systems (if the OS or filesystem does not support symlinks, then they are emulated).

This program has a GUI and a command line interface.

Project page:
http://pybag.sourceforge.net

Bugs trucker: http://sourceforge.net/tracker/?group_id=258722&atid=1129796
IF YOU LIKE PYBAG AND FOUND IT USEFUL WHEN YOU CAN DONATE TO AUTHOR SOME MONEY AT PROJECT PAGE: http://pybag.sourceforge.net/donate_en.html

If you do not want donate money then you can treat the author cap of coffee and pizza.

THANK YOU.

Installation

Program not need into installation.

For work with PYBAG you must create bag folder in place where you will be keep you files and copy pybag.py file into this directory. And initialize bag folder by next command: > python pybag.py --dist -i -m0For run program with grafical interface execute next command:
> python pybag.pyIf program location is not initialized then you will be asked for initialization.

Ask for initialization

Some commands from command line can work without initialization. This is next commands: --dist, --about, --author, --license, --help, --usage, --copyright.

Notes.

If you already using PYBAG you can easy copy new version instead previous.

In PYBAG version 0.3.0 was changed internal database format (now is v2.0), but all previous version of PYBAG is supported.
If you use new version than you can't read new database by previous version of program - this is no matter, use new version of PYBAG.

Requirements

Python 2.5.1 ... 2.7 ... - http://sourceforge.net/projects/python.

For GUI you need:

    wxPython 2.8.10 + - http://sourceforge.net/projects/wxpython.

Quick start with GUI

You have three places with you files:
You wish have identical copies of files in all places. Also you flashdrive will be save this files as backup copy. Also you wish easy synchronize you copies after editing files.

In home descktop you keep original files in different directories:
1. /home/user/docs1/... - any documents.
2. /home/user/memo.txt - file which you edit often (evry day for example).
3. /home/user/news/... - directory with downloaded news (you download news and read they then you have free time).

We will have 2 points of synchronization:

Now start use of PYBAG.

Create bag directory in flash drive:/flash/bag/Copy to this directory file "pybag.py":
/flash/bag/
...........pybag.py

Run PYBAG in flashdrive:python /flash/bag/pybag.pyYou will be asked about initialization current location ( /flash/bag/ ).

Ask for initialization PYBAG

Answer Yes, and PYBAG will be started. Now we synchronize flashdrive with desktop.

Main window of PYBAG

In main window turn off emulation mode by unchecking  "Emulation" checkbox.
In main menu select "File --> Add root ..." for adding root - you directories and files which you want synchronize.

Add root to PYBAG

In box "Select path type" chek "Directory". Enter or select throw button " ... " first path /home/user/docs1, skip other options by default and press button "Add root".
Same add file /home/user/memo.txt only in path type select "File or symlink".
Add third root directory /home/user/news.
In toolbar press "Compare files" button Compare files. Files will be readed and compared with bag. This is first synchronization and all files will be marked as copied to bag.
You can view files list and its action in main window.
For synchronization press "Synchronize files" button Synchronize files.
If no errors then you can see empty files list. Press filter button "Filter OK synchronization" Filter OK synchronization and see files which will be synchronized.
Now in bag contains you files.

/flash/bag/
...........pybag.py
...........pybagfiles/
......................docs1/
............................ ... any files
............................ ... any files
......................news/
............................ ... any files
............................ ... any files
......................memo.txt
...........pybag.cfg
...........pybag.db
You flash drive now is full synchronized with you home descktop.

You go work and create into work descktop bag which will be synchronized with you flash drive.

Create bag into work desctop:
/work/user/bag
Run PYBAG in flashdrive:python /flash/bag/pybag.pyAnd distribute PYBAG and roots and it's settings from flashdrive bag to work desktop:
turn off emulation mode by unchecking  "Emulation" checkbox and choose menu "File --> Distribute ..." and in shown dialog select "Initialize".

Distribute PYBAG

After you see window with list of roots, select all and press "OK".

Distribute PYBAG, select roots

You PYBAG  and roots preferences will be copied to /work/user/bag.
Distribute need only once. In next times need only synchronization.

 Run PYBAG in work desktop:python /work/user/bag/pybag.pyYou will see main window of PYBAG. Now you must synchronize new bag in work with flash bag.
In main window turn off emulation mode by unchecking  "Emulation" checkbox.
In toolbar press "Compare files" button Compare files. Files will be readed and compared with bag. All files will be marked as copied to bag.
You can view files list and its action in main window.
For synchronization press "Synchronize files" button Synchronize files.
If no errors then you can see empty files list. Press filter button "Filter OK synchronization" Filter OK synchronization and see files which will be synchronized.

Now you can work with you files in work descktop.

Befor you go home you must synchronize bag. Start PYBAG in work,
turn off emulation mode by unchecking  "Emulation" checkbox, in toolbar press "Compare files" button Compare files.
In files list will be shown changed, deleted or new files.
For synchronization press "Synchronize files" button Synchronize files.
Go home and run PYBAG in flashdrive - synchronize you files.
All changes will be writen to home descktop.

Quick start with CLI

You have three places with you files:
You wish have identical copies of files in all places. Also you flashdrive will be save this files as backup copy. Also you wish easy synchronize you copies after editing files.

In home descktop you keep original files in different directories:
1. /home/user/docs1/... - any documents.
2. /home/user/memo.txt - file which you edit often (evry day for example).
3. /home/user/news/... - directory with downloaded news (you download news and read they then you have free time).

We will have 2 points of synchronization:

Now start use of PYBAG.

Create bag directory in flash drive:/flash/bag/Copy to this directory file "pybag.py" or distribute they from existings location:
python pybag.py --dist -m0 /flash/bag where m0 - turn off emulation mode (this mode turn on by default to prevent inaccurate use of program).
/flash/bag/
...........pybag.py

Change working directory to /flash/bag:cd /flash/bag Initialize pybag files into current (/flash/bag) location:flash/bag > python pybag.py --dist -i -m0
Also you can run program with needed command. If current program location not initialized, then you asked for initialization. You can answer "y" and after initialization command execution will be continued. /flash/bag/
...........pybag.py
...........pybagfiles/
...........pybag.cfg
...........pybag.db
Add origin roots to bag:flash/bag > python pybag.py --add -kc -e".*,*~" "/home/user/docs1" "/home/user/memo.txt" "/home/user/news" where kc - copy symlink (or ignore if use -ki), e".*,*~" - ignore all hidden files (started from dot), and ignore all backup copies (ends with tilda).
Last parameters - paths to directories and files that you want add to bag.

Now you must synchronize you bag:
flash/bag > python pybag.py --sync -m0 You see that in origin will be found number new items (it is you three roots and all items into this directories). Also you see report about number items which will be ignored. If you wish view more detailed report you must use option -v4 (default is -v3). Also detailed report into logging file into bag directory "pybag.log".

CLI window

You view report about files which changed and will be synchronized and prompt "Enter action (h - for help):" and if you agree with report you may answer "y" to continue or "n" for cancel.
Also you can pres "h" and view available options.

/flash/bag/
...........pybag.py
...........pybagfiles/
......................docs1/
............................ ... any files
............................ ... any files
......................news/
............................ ... any files
............................ ... any files
......................memo.txt
...........pybag.cfg
...........pybag.db
You flash drive now is full synchronized with you home descktop.

You go work and create into work descktop bag which will be synchronized with you flash drive.

Create bag into work desctop:
/work/user/bag Change working directory to flash bag:
cd /flash/bag Distribute all roots from flash bag to working bag:
flash/bag > python pybag.py --dist -i -a -m0 "/work/user/bag" Change working directory to working bag:
cd /work/user/bag View synchronization report:
work/user/bag > python pybag.py --sync -m0and continue synchronization if agree with report.

Now you can work with you files in work descktop.

Befor you go home you must synchronize bag:
work/user/bag > python pybag.py --sync -m0
When you coming to home you also synchronize:  flash/bag > python pybag.py --sync -m0 All changes will be writen to home descktop.

For detailed program features see section about commands.

PYBAG alphabet

Before start using PYBAG is good get few information about it principles.

PYBAG synchronize files between origin and bag.
origin
this is original location of you files.
bag
this is place where you save you files for carry or backup.
For example origin - is you folder in desctop computer, bag - is folder in flashdrive.
For example lets view folders on the descktop:

1. /home/user/docs1/... - any documents.
2. /home/user/memo.txt - file with memos which you edit often (evry day for example).
3. /home/user/news/... - recived news which you read in rest.

All this folders and files (docs1, memo.txt, news) will be origin.

Also in PYBAG have word root - this is mean one of origin which added to bag. If you add
/home/user/docs1 to synchronization its will be named root "docs1". /home/user/memo.txt will be named as root "memo.txt". And so on.

Bag has a next directory structure
  • pybagfiles/ - Directory where files saved in bag.
  • pybag.db - File list database.
  • pybag.cfg - Configuration file in utf-8.
  • pybag.log - Log file in utf-8.
  •  ...~ - File ends with tilda "~" is backup.
All roots and its contents (synchronized files) placed into subfolder pybagfiles.
For example root "docs1" will be placed in path /flash/bag/pybagfiles/docs1.

All files from origin when you synchronize saved in roots. And if you want work with you bag you must see needed files in /flash/bag/pybagfiles/"rootname"/...
In bag you files structure will be next:
/flash/bag/
...........pybag.py
...........pybagfiles/
......................docs1/
............................ ... any files
............................ ... any files
......................news/
............................ ... any files
............................ ... any files
......................memo.txt
...........pybag.cfg
...........pybag.db
Synchronization in PYBAG done in several steps:
reading
Read files in origin, bag roots and in database (PYBAG database save information about нщг files).
comparing
PYBAG compare readed files each other and decide what to do - copy, delete or nothing.
synchronization
In this step execute all actions for files.
clearing
Clear databse from ignored and deleted files.
saving
save information about file in database.
When you press Compare button go reading and comparing. When you press Synchronize button do synchronization, clearing and saving. If you press Synchronize without comparing when will do all steps. In comparing and synchronization process PYBAG can write log information to file (also can write debug information).
When PYBAG comparing files may arise any conflicts. For example if file was modified in bag and in origin then PYBAG do know what to do. In this situation this file will be marked as conflict and you must see it and decide what to do. Also not serious situation (for example if file in bag and origin was deleted but in PYBAG database stay) files marked as warning. In critical situation (when error in reading or saving file or other) files marked as error.
When you view recomended by PYBAG operation under files then you can manualy change it - force. For example if conflict occur you can manualy cpecify what do - copy, delete or skip file.
Files in PYBAG compared by statistic information (size, modification date) and if you turn on by crc32 checksum (by checksum files compared only if other parameters are equal).
PYBAG can synchronize directories, files and symlinks. Symlink supported not all operating system but PYBAG can emulate symlink if OS do not support it. Emulation symlinks do by next: created text file have same name as symlink and it contain special information about symlink.

You can set how synchronize symlinks:
  • c, copy - copy symlink, emulate if need.
  • cn, copynoemul - copy symlink, do not emulate symlink.
  • i, ignore - ignore symlink, emulation check if need. It is default.
  • in, ignorenoemul - ignore symlink, do not emulation check.
Roots in PYBAG may be two types:
  • standart - This is default roots. With this roots you can change filea in bag and in origin and all changes was detected.
  • backup - This is special mode for backup files. In this mode detected only changes in origin files but not in bag. This mode is up 2 times faster then standart. If you has changed files in backup bag then you can use special synchronization mode Backup full synchronization for this roots.
Daylight saving problem.

In several conditions (for example when synchronize Windows and FlashDrive with FAT) you may have problems with daylight saving. Details is next - you synchronize all you files in evening and in night was changed time for daylight saving. In the morning  you found that all you files was changed (modification date between bag and origin different about 3600 seconds)!!! Now in synchronization was copyed all files.This is bad do copy all files! You can use "time shift" operation instead real copying. Timeshift is only change modification (and access) date. "Time shift to bag" mean that for all marked files in bag will be set modification date same as in origin. "Time shift to origin" mean that for all marked files in origin will be set modification date same as in bag.
       
In CLI interface you can use "-y" option for set time shift manualy or use action "tsbag", "tsorigin", "tsreset" for set (reset) timeshift by template. In GUI you can use menu "Action->Timeshift-> ... " for set time shift by template. Set time shift by template means that you specify file which needs in time shift and it become template - calculated time difference from this file used for all other files.

PYBAG have several settings for synchronization process.

Grafical interface

Program in grafical interface will be work only from initialized folder.
If you run program from not initialized location you will be asked for initialization.
In itialization process created needed for work files and folders.

Ask for initialization PYBAG

Main window

In this window you do all operation. You can select commands from menu or use toolbar for several commands. Toolbar have compare and synchronize button, filters and buttons for forced action.
In main window you can adjust all needed for synchronization settings. In files list displayed all compared items and actions and results for it. In output window you can see text information about process and results.
You can hide or show output window from checking menu View --> Output, and clear output window View --> Clear output. If you dooble click on splitter for output window then output will be hided.
In files list you can use context menu for do any action on items or change columns.
Dooble click on item will show item properties dialog.

Available settings in main window:
Select roots for synchronization
Here you can select roots which you want synchronize. By default selected all roots. See also menu Roots.
Auto Conflict
Set rules for auto conflict resolving.
Verbosity
Set verbosity level for output information into output window.
Emulation
Turn on/off emulation mode. If emulation on then no changes will be made in files, no configuration save.
Logging
Turn on/off logging into pybag.log file.
Debug logging
Turn on/off debug logging.
Modify date delta
Set modification time delta (difference) used in comparison. If  modification time difference in files less then this value then files is deside equal.
Backup full synch
Use for backup roots full synchronization mode. In this mode buckup roots will be full synchronized (in standart mode readed only files in origin and changes and new copied to bag).
Time shift
Show time shift settings: direction (Bag, Origin, None) and shift times values in seconds for bag "b:0.0" and for origin "o:0.0".
List path filter ( ... )
In this field you can enter filter for files list. Filter will be applied to Path column. You can use wildcards ( * - mean any amount any symbols, ? - mean one any symbol) or regular expression (must starts from exlamination "!"). Filter appleing after pressing ENTER key or button Refresh list.

Main window

Menu

Toolbar


Compare Compare files. If need files will be automatic readed.
Syncronize Synchronize files. If need files will be automatic readed and compared. Command --sync.
Filter OK synchronization Filter. Show items after synchronization with no errors.
Filter Warning Filter. Show items with warnings.
Filter conflict Filter. Show items with conflicts.
Filter errors Filter. Show items with errors.
Filter to bag Filter. Show items which will be copied to bag.
Filter to origin Filter. Show items which will be copied to origin.
Filter new Filter. Show new items.
Filter changed Filter. Show changed items.
Filter delete Filter. Show items marked to delete.
Filter ignored Filter. Show ignored items.
Filter unchanged Filter. Show unchanged items.
Filter forced Filter. Show items with forced action.
Filter file Filter. Show files.
Filter directory Filter. Show directories.
Filter symlink Filter. Show symlinks.
Filter unknown items Filter. Show unknown items.
Force unchanged Filter. Show items for which time shift operation performed.
Force unchanged Force comparison result - mark file as unchanged. Operation aplied to selected files.
Force to bag Force comparison result - mark file to topy into bag. If file is absent in origin, then will be marked as unchanged. Operation aplied to selected files.
Force to origin Force comparison result - mark file to copy into original.If file is absent in bag, then will be marked as unchanged. Operation aplied to selected files.
Force delete Force comparison result - mark file for removing. File wiil be deleted in bag and origin. Operation aplied to selected files.
Restore Restore comparison results - if file will be marked/forced manualy then action reset back. Operation aplied to selected files.
Auto Conflict Select rules for auto conflict resolve.
Verbosity Select verbosity level. Option -v
Emulation Turn on / off emulation mode. Option -m
Logging Turn on / off logging.  Option -l
Debug logging Turn on / off debug logging. Option-t
Modify date delta Set modification time delta, when comparing files if its time delta less then modify delta then files times assign as equal.
Backup mode synchronize For backup roots use mode with full synchronization.

Files list

Files list display information about items, it's state and actions. List filled after comparison and synchronization. Displayed information may be filtered. For filter list you can use toolbar or menu Filter. 
In file list you can select any columns for display.
For adjust columns use context menu by clicking right mouse button on column header or menu Options --> Preferences....
In context menu you can show/hide any column and move clicked column To left or To right. Context menu command Reset to config will reset you columns settings to settings in configuration file (this settings changed in
Options --> Preferences... menu.

By click right button on visible item you can choose action under selected item:

Available columns.

Column heading Column description Column name in
configuration file
Error Item errors mark (e - error, c - conflict, w - warning).
err
State Item state icon. stateicon
Action Item action icon. actionicon
Path Item path in bag. path
Description Description. desc
Direction Action direction:
  • <<< - New in origin, copy to bag.
  • >>> - New in bag, copy o origin.
  • <-- - Changed in origin, copy to bag.
  • --> - Changed in bag, copy to origin.
  • xxx - Delete item.
  • --- - Ignored item.
  • === - Unchanged item.
  • <== - Unchanged item. Time shift to bag.
  • ==> - Unchanged item. Time shift to origin.
  • *** - Error marker in filter and programm. Note author if this situation appears.
dir
Forced Forced state (! - item action is forced). forced
Type Item type:
  • f - file,
  • d - directory,
  • s - symlink,
  • empty - unknown (or may be ignored).
type
Size DB Item size in DB, bytes. sizedb
CRC32 DB Item CRC32 sum in DB. crc32db
Symlink DB Symlink in DB. symlinkdb
MDate DB Item date in DB, float. mdatedb
GMT Date DB Item date in DB, GMT. gmdatedb
Local Date DB Item date in DB, Local. lmdatedb
Size  bag Item size in bag, bytes. sizebag
CRC32 bag Item CRC32 sum in bag. crc32bag
Symlink bag Symlink in bag. symlinkbag
MDate bag Item date in bag, float. mdatebag
GMT Date bag Item date in bag, GMT. gmdatebag
Local Date bag Item date in bag, Local. lmdatebag
Size origin Item size in origin, bytes. sizeorigin
CRC32 origin Item CRC32 sum in origin. crc32origin
Symlink origin Symlink in origin. symlinkorigin
MDate origin Item date in origin, float. mdateorigin
GMT Date origin Item date in origin, GMT. gmdateorigin
Local Date origin Item date in origin, Local. lmdateorigin
TS
Time shift operation:
  • b - time shift to bag,
  • o - time shift to origin,
  • empty - no time shift.
timeshift


State icon
- show information about item type and errors.

File Item is a file.
Directory Item is a directory.
Symlink Item is a symlink..
Unknown Item is unknown type.
Конфликт This icon mean that PYBAG do know which icon use (this is no good, write about this situation to author).
File OK Directory OK Symlink OK Items after synchronization - all OK.
File warning Directory warning Symlink warning Items have warnings. Items will be synchronized (but you may want see warning).
File conflict Directory conflict Symlink conflict Items with conflicts. Shown only unresolved conflicts. Items will not synchronize without specifieing manual action.
Details about conflicts see in description column and more detiles in log window.
File error Directory error Symlink error Item with errors. Will be not synchronized. Details about errors see in description column and more detiles in log window.

Action icon - show information about needed action after comparing or about synchronization result.

To bag Item changed and will be copied to bag.
To origin Item changed and will be copied to origin.
New, to bag New item in origin, will be copied to bag.
New, to origin New item in bag, will be copied to origin.
Delete Item will be deleted.
Unchanged Item unchanged. No action.
Unchanged Item unchanged. Time shift to bag - set in bag modification date same as in origin.
Unchanged Item unchanged. Time shift to origin - set in origin modification date same as in bag.
Forced This box around other icons mean that item action is forced (manual or with automatic conflict resolution).
OK This mean that synchronization with no errors.
WarningConflictError Synchronization with errors.
Attention This mean that program can't select icon, see item description for details about item action.

Preferences dialog.

In preferences dialog you can change PYBAG settings.

Dialog have three tabs:
For realy change settings - emulation mode must be turn off. If emulation is on then changes will not be saved any way.All changes in settings saves only when you press OK button. If you press Cancel when all changes will be discarded.


Global preferences

Here you can change default parameters which used when program start.

Global settings


Roots preferences

Here you change preferences for roots. Select needed root and adjust its settings.

Roots settings


Columns preferences

In preferences displayed columns settings saved in configuration file.
You may change columns order, show/hide its and change columns width.
You can:
If you check Save columns changes when exit from PYBAG then all columns changes in main window will be auto saved in configuration file when program exit (emulation mode must be turn off, otherwise changes will not save).

When you change column visibility or width then you must press Apply button.
After changes and saving preferences, columns changes not displayed in pogram, they saved to configuration file.
To apply changes to main window you can press right mouse button on column headers and in context menu select Reset to config.


Columns settings

Add root dialogs

For adding new root you must first select path type. This may be directory or file/symlink. After select path type adjust root properties. In next press [ ... ] button for select path (or you an enter it manualy).
Press Add root button. In output in main window you can read information about success.
For real root adding emulation mode must be turned off.

Add root

Remove root dialog

Select roots which you can delete and press OK button. Then root deleted all files for this root in bag will be removed too.
For real root deleteng emulation mode must be turned off.

Remove roots

Distribute dialog

Distribute PYBAG to specified location. Have several variants for distribution. In all variants PYBAG program file will be copied to destination.
In first you must select what you want:
Initialize
Only initialize destination - create needed files and folders.
Copy additional files
Copy all files (exclude specific for PYBAG - configuration, bag files and database) founded in current location to destination.
Initialize and copy files
As two previous types together.
In next step select roots which you can distribute to destination. Select nothing if you do not want distribute roots. And press OK. About success you can read in output window.

If you distribute PYBAG with roots in already existing folder with other PYBAG then will be overriden only program file. Roots will be added to already existing in destination. But distributed roots must not be in destination, otherwise its will be skiped.

Select type of distribution.

Distribute - select destination

Distribute - select roots.

Distribute - select roots

Relocate dialog

Relocate - change location of origin files. If you move origin files to other place then you can use relocate for select for existing roots new location of origin files. In shown dialog select root and after press OK button select path where you place origin files.

Properties dialog

This dialog show detailed information about selected item. Shown information reade from bag, origin and PYBAG database.

Properties dialog

Statistic dialog

In this dialog you can see statistics information for each root separately and summary statistics for all roots.

Statistic dialog

Commands and options

Command line:
pybag.py --command -option1 -option2 argument1 argument2 ... Warning: At once may be executed only one command. Recomendation: Use emulation mode -m1 (default is on) before real files operation (exclude --dist). For real operation you need use option -m0.

 Commands

Without commands and options run GUI interface (as --gui command). --add { -kFLAG -sFLAG -eFILEMASK -bFLAG -rDIR } path1 {path2 ...} Add new roots to bag.
If option -k -e -s is not specified then will be used it's default values (symlink ignore, all files, stat comparison).
In next step you must synchronize pybag with --sync command.
Options in this command set properties for added roots and for next synchronizations.
In the future you can manualy edit pybag.cfg for change root properties.

Options:
If you have backup root in bag from previous versions you can set to this roots into configuration file option: backup = 1, and use it now as backup (synchronization will be up 2 times faster).

> python pybag.py --add -kc -e".*,*~" "/home/user/docs1" "/home/user/memo.txt" "/home/user/news" where kc - copy symlink,
e".*,*~" - ignore all hidden files (started from dot), and ignore all backup copies (ends with tilda).
Last parameters - paths to directories and files that you want add to bag.
--remove root1 {root2 ...} Remove roots from bag. Do not remove any items from origin location.
--gui
Run program with GUI.
 --dist {-z} {-i} {-a} {-rROOT1 ...} {path1} Distribute PYBAG program to specified location.
This do clear distribute without any files in current bag.
If options -r or -a is given then in destination path also adjust pybag.cfg to point original to this (current) point.
If you point "path1" into other pybag then adding all to it.
If you initialize -i then you may not specify "path1". With other options "path1" is required.

> python pybag.py --dist -i -m0Initialize current location.

> python pybag.py --dist -i -a -m0 "/work/user/bag" Initialize location /work/user/bagCopy to it pybag.py, also add all roots from current location to new bag location.

 --sync { -fFILE } {-dDIR} {-dDIR} {-sMDDELTA} { -pA } { -bFLAG } { -gOUTFILTER } { -yFLAGVALUE } {path1} Synchronize current bag with original files. If "path1" specified then syncronize with specified location (path1).
If no "-f" option given then try sync all pybag roots in path "path1/r".
If specified "-f" then "path1" must correspond path in option.
After comparing files you will be need confirm continue synchronization by action y or cancel by n.
Options:
If you not use autoanswer (option -p) then will be displayed interactive menu. In this menu you can use next commands:
When you vew report by page (used option -z00) then in page menu you can:
  • Press ENTER for view next page,
  • Enter NUMBER for new page size,
  • Enter q for quit from report,
  • Enter a for list all items.

For backup purpose add root as backup: python pybag.py --add -b1 root. If you have backup bag from previous versions you can set to this roots into configuration file option: backup = 1, and use it now as backup (synchronization will be in 2 times faster).


--relocate -rROOT=NEWPATH { -rROOT=NEWPATH ...}Realocate root. Replace origin path for ROOT by new NEWPATH. (Realy change only configuration file).
--stat { -rROOT -rROOT ... }Show statistics about bag. If specified options -r then shown statistics only for specified roots. If no option -r specified then shown statistics for all roots.

--cleandb Clean DB from old records (old roots which already removed).
--help
-h
--usage
Display help information.
--versionShow versiony.
--authorShow author.
--copyrightShow copyright.
--licenseShow license.
--aboutAbout information.
--debug {name ...}Set turn on simple and debug logging and call _debug function. For debug purpouse only. Must be first in options list. If get name then call only this methods ("_test_name") if exists. Warning: Right tests will be only into source distribution. In copied files ( for example distributed with --dist ) number tests will be failed.

Common options

This options may be used for all commands.

Common information

Directory structure

PYBAG copy all you files and folders into "./pybagfiles" folder.

Data base file

Information about all entities in "pybagfiles" folder written into DB "./pybag.db" - gziped text file in utf-8 encoding.
In DB saves files in bag size, modify date, crc32 for all files in bag.

In DB files placed in next format
DB_VERSION_MARKER
DB_VERSION
F SIZE MDATE CRC32 path_to_file1_in_pybagfiles link_point1
F SIZE MDATE CRC32 path_to_file2_in_pybagfiles link_point2
... and so on.
All lines must end with newline, where:

Configuration file

It is "pybag.cfg" file where saved preferences.
Format is next:


Get pybag at SourceForge.net. Fast, secure and Free Open Source software downloads