Code Monkey home page Code Monkey logo

oc-backup's Introduction

oc-backup's People

Contributors

julianpoemp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cterkpetey

oc-backup's Issues

Warnings from mysqldump are being seen as an error

``In this part of the code (the echo is something I inserted), it appears to be trying to exclude warning errors from mysqldump, but it's indicating that the dump experienced an error.

 if [ "${#stderr}" -gt 0 ]; then
    echo "mysqldump error: ${stderr}"
    if ! [[ "${stderr}" =~ ^mysqldump:[[:space:]]\[Warning\] ]]; then
      log "Error: SQL backup failed."
      log "_${stderr}_"
      errors_found=$((errors_found + 1))
    fi
  fi

Here is the logging output:

root@conf:/var/www/owncloud# ./oc_backup.sh
* 2023-02-15_14-52-45 | Start oc-backup v1.0.2...
* 2023-02-15_14-52-45 | -> Backup owncloud configuration file...
* 2023-02-15_14-52-45 | -> Read owncloud configuration file...
* 2023-02-15_14-52-45 | -> Enable maintenance mode...
* 2023-02-15_14-52-45 | -> Create backup folder
* 2023-02-15_14-52-45 | -> Create database backup...
* 2023-02-15_14-52-46 | mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump error: mysqldump: [Warning] Using a password on the command line interface can be insecure.
* 2023-02-15_14-52-46 | Error: SQL backup failed.
* 2023-02-15_14-52-46 | _mysqldump: [Warning] Using a password on the command line interface can be insecure._
* 2023-02-15_14-52-46 | -> Create zip archive of owncloud files...

Am I missing something, here?

Doesnt turn off maintenance - escaping backslash remains in config.php

Hello Julian and thx for you work.

I had a problem with the script. It didnt turn off the maintenance mode.
Is there really the need for escaping?

`enable_maintenance_mode() {
log "-> Enable maintenance mode..."
configFile="${configFile//\'maintenance\' => false/\'maintenance\' => true}"
echo "${configFile}" > "${configPath}"
}

disable_maintenance_mode() {
log "-> Disbale maintenance mode..."
configFile="${configFile//\'maintenance\' => true/\'maintenance\' => false}"
echo "${configFile}" > "${configPath}"
}`

My Installation (Debian on a Raspberry) only works without:

`enable_maintenance_mode() {
log "-> Enable maintenance mode..."
configFile="${configFile//'maintenance' => false/'maintenance' => true}"
echo "${configFile}" > "${configPath}"
}

disable_maintenance_mode() {
log "-> Disbale maintenance mode..."
configFile="${configFile//'maintenance' => true/'maintenance' => false}"
echo "${configFile}" > "${configPath}"
}`

v1.0.0 release

  • Check all required and optional constants at startup
  • Add argument for config-path
  • Add argument for help
  • Improve error handling
  • Append log file next to the backup
  • If OC_DATA path is empty, data folder is in owncloud folder and no additional backup needed
  • Add explanation of how to add a cronjob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.