• Select language EN RU

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:

  • /home/user/docs1/... - any documents.

  • /home/user/memo.txt - file with memos which you edit often (evry day for example).

  • /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 you 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.

verbosity

Set verbosity level -15. Default assign 3.

  • -1 - No output. Only log file.

  • 0 - Only global errors.

  • 1 - Very small output, only about success and errors.

  • 2 - As 1 and conflicts.

  • 3 - Normal output. Common information and errors, conflicts, warnings.

  • 4 - Large output. As 3 and file operation.

  • 5 - Huge output. As 4 and logging.

Emulation mode

If this mode turn on then PYBAG do not do any changes in files and configuration files. Emulation mode good for training and testing.

Logging

Allow or disable write log information about program work to log file.

Debug logging

As logging but writen information will more and more. This mode good for developing and errors reports.

Auto Conflict resolution

Set action in case if comparing conflict occur. This action will be forced automaticaly:

  • bag - write changed files into bag if conflicts.

  • origin - write changed files into original location if conflicts.

  • newer - newer files overwrite older if conflicts.

  • older - older files overwrite newer if conflicts.

  • no - do not change files if conflicts (is default).

  • bagall - write all changes from origin to bag (delete if need).

  • originall - write all changes from bag to origin (delete if need).

  • bagcopy - copy all changes to bag, but do not delete from bag anything.

  • origincopy - copy all changes to origin, but do not delete from origin anything.

Modifycation time delta (MDDELTA)

This is difference between compared files modification time. If difference less then MDDELTA then files decide equal.

Backup full synchronization

Special mode for full synchronization backup roots. In this mode detected files changes not only in origin but in bag too.