API
grebakker - greyrat's backupper for hackers.
Log
Handles logging of performed actions in CSV or JSON format.
__init__(name, restart, log_format, off)
Initialize the Log object.
| Parameters: |
|
|---|
write(act, src, dst, duration)
Write a log entry about a performed action.
| Parameters: |
|
|---|
error(error)
Write a log entry about an error.
| Parameters: |
|
|---|
close()
Close the log file.
Grebakker
Perform backup operations.
__init__(dest, log, verbosity)
Initialize the Grebakker object.
| Parameters: |
|
|---|
_action_begin(mml_action, path, level)
Report the beginning of an action, return starting time.
| Parameters: |
|
|---|
| Returns: |
|
|---|
_action_end(action, path, dst, level, t1)
Report the end of an action and logs it.
| Parameters: |
|
|---|
_yield_files(src, exclude)
Yield files from the source directory, excluding specified patterns.
| Parameters: |
|
|---|
| Yields: |
|
|---|
_i(level)
Return indentation spaces for the given output level.
| Parameters: |
|
|---|
| Returns: |
|
|---|
_destination_exists(action, src, dst, level)
Determine the destination path for an action.
| Parameters: |
|
|---|
| Returns: |
|
|---|
copy(src_root, item, dst_root, level)
Copy files or directories from source to destination.
| Parameters: |
|
|---|
| Raises: |
|
|---|
compress(root, item, dst_root, level)
Compress files or directories into a ZIP archive.
| Parameters: |
|
|---|
| Raises: |
|
|---|
decompress(root, item, dst_root, level)
Decompress ZIP archives.
| Parameters: |
|
|---|
| Raises: |
|
|---|
run(action, root, level=0)
Perform an action.
| Parameters: |
|
|---|
main(arguments=[])
Run grebaker using the given parameters.
| Parameters: |
|
|---|
| Returns: |
|
|---|
script_run()
Execute from command line.