Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zip Compression #351

Open
rohan-nitsan opened this issue Nov 27, 2023 · 2 comments
Open

zip Compression #351

rohan-nitsan opened this issue Nov 27, 2023 · 2 comments
Assignees

Comments

@rohan-nitsan
Copy link

rohan-nitsan commented Nov 27, 2023

I used the zip compression technique.

But the compressed file was saved with only .tar.
It's working fine with gzip and bzip2 compression.

I also get an error in the generated log

"errors": [
        {
            "class": "RuntimeException",
            "message": "Command failed:\n  exit-code: 3\n  message:   \n",
            "file": "phar:\/\/\/var\/www\/html\/typo3conf\/ext\/ns_backup\/phpbu.phar\/lib\/sf-cli\/Command\/Runner\/Simple.php",
            "line": 57
        }
    ],

Here is my configuration json

{
  "verbose": true,
  "debug": false,
  "logging": [
    {
      "type": "json",
      "target": "/var/www/html/rohan/uploads/tx_nsbackup/json/test_fileadmin_log.json"
    },
    {
      "type": "mail",
      "options": {
        "transport": "mail",
        "recipients": "[email protected]",
        "subject": "[fileadmin] Test - NS Backup Email",
        "sendOnlyOnError": "0"
      }
    }
  ],
  "backups": [
    {
      "name": "27112023_1333_Test",
      "source": {
        "type": "tar",
        "options": {
          "path": "/var/www/html/fileadmin"
        }
      },
      "target": {
        "dirname": "/var/www/html/rohan/uploads/tx_nsbackup/fileadmin",
        "filename": "fileadmin-%Y%m%d-%H%i.tar",
        "compress": "zip"
      },
      "cleanup": {
        "type": "quantity",
        "options": {
          "amount": "2"
        }
      }
    }
  ]
}

Generated json log

{
    "status": 1,
    "timestamp": 1701092018,
    "duration": 0.0447,
    "backupCount": 1,
    "backupFailed": 1,
    "errorCount": 1,
    "errors": [
        {
            "class": "RuntimeException",
            "message": "Command failed:\n  exit-code: 3\n  message:   \n",
            "file": "phar:\/\/\/var\/www\/html\/typo3conf\/ext\/ns_backup\/phpbu.phar\/lib\/sf-cli\/Command\/Runner\/Simple.php",
            "line": 57
        }
    ],
    "backups": [
        {
            "name": "27112023_1333_Test",
            "status": 1,
            "checks": {
                "executed": 0,
                "failed": 0
            },
            "crypt": {
                "executed": 0,
                "skipped": 0,
                "failed": 0
            },
            "syncs": {
                "executed": 0,
                "skipped": 0,
                "failed": 0
            },
            "cleanup": {
                "executed": 0,
                "skipped": 0,
                "failed": 0
            }
        }
    ],
    "debug": [
        "\/usr\/sbin\/tar -cf '\/var\/www\/html\/rohan\/uploads\/tx_nsbackup\/fileadmin\/fileadmin-20231127-1333.tar' -C '\/var\/www\/html' 'fileadmin'",
        "exception: Command failed:\n  exit-code: 3\n  message:   \n"
    ]
}
@sebastianfeldmann sebastianfeldmann self-assigned this Nov 27, 2023
@sebastianfeldmann
Copy link
Owner

Exit code 3 happens when a file is changed during the backup process.
You can add the ignoreFailedRead option to your config and set it to true.
This is of course risky and you should check your backups regularly :)

The zip issue is, that depending on your OS zip is not available. phpbu will always create tars so your backup becomes a single file to move around. Especially if your backup source is a directory.

@rohan-nitsan
Copy link
Author

Hi @sebastianfeldmann,

Thanks for your answer.
I tried the ignoreFailedRead configuration, but still i got the same error.

Here is my json configration

"source": {
    "type": "tar",
    "options": {
        "ignoreFailedRead": true,
        "path": "/var/www/html/fileadmin"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants