Skip to content

Skip tar exit code 1 #209

@kr31n3r

Description

@kr31n3r

Environment

  • TwinDB Backup version: 2.18.3
  • Operating System: debian 9.9

Description

While trying to backup a /var/www/<SOME_FOLDER> the twindb-backup terminates early due to the following error:

ERROR: file_source.get_stream():46: Failed to read from /var/www/<SOME_FOLDER>: tar: Removing leading `/' from member names
tar: /var/www/<SOME_FOLDER>: file changed as we read it

So /var/www/<SOME_FOLDER> changed during backup and tar will return with exit code 1 as stated in man page:

RETURN VALUE
       Tar exit code indicates whether it was able to successfully perform
       the requested operation, and if not, what kind of error occurred.

       0      Successful termination.

       1      Some files differ.  If tar was invoked with the --compare
              (--diff, -d) command line option, this means that some files
              in the archive differ from their disk counterparts.  If tar
              was given one of the --create, --append or --update options,
              this exit code means that some files were changed while being
              archived and so the resulting archive does not contain the
              exact copy of the file set.

       2      Fatal error.  This means that some fatal, unrecoverable error
              occurred.

       If a subprocess that had been invoked by tar exited with a nonzero
       exit code, tar itself exits with that code as well.  This can happen,
       for example, if a compression option (e.g. -z) was used and the
       external compressor program failed.  Another example is rmt failure
       during backup to a remote device.

Suggestion

Change Line 45 in

if proc.returncode:

to only exit on proc.returncode > 1 for not stopping backing up further files/folders

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions