Want more timely Centmin Mod News Updates?
Become a Member

CMM Backup Script

Discussion in 'Add Ons' started by brijendrasial, Jan 8, 2019.

  1. fabianski

    fabianski Member

    102
    14
    18
    Feb 20, 2019
    Brazil
    Ratings:
    +36
    Local Time:
    5:48 AM
    Is there any way to create a backup routine?
    Daily a backup of the database and sends it to google drive
    And weekly a backup of the files and send to the drive
    I think this would be enough for most people
     
  2. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    I have that in my mind. I will make as I get time.
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    3,831
    374
    83
    May 31, 2014
    Ratings:
    +718
    Local Time:
    11:48 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Daily for both :)
     
  4. upgrade81

    upgrade81 Premium Member Premium Member

    266
    16
    18
    Sep 5, 2016
    Italy
    Ratings:
    +27
    Local Time:
    10:48 AM
    1.17
    10.3
    Is it possible to do this with cron?
     
  5. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    ./script.sh -b

    Using the above command you can set cron to make local backups.
     
  6. Dnyan

    Dnyan Member

    95
    19
    8
    Sep 16, 2017
    Ratings:
    +26
    Local Time:
    2:18 PM
    1.17.8
    10.3.22
    it would be better if there is tutorial on how to install and use this addon / script.
     
  7. iotivedo

    iotivedo New Member

    5
    2
    3
    Apr 13, 2019
    Ratings:
    +3
    Local Time:
    10:48 AM
    1.15
    Maria DB 10.3
    What about incremental remote backup? It's possible?
     
  8. Jon Snow

    Jon Snow Active Member

    528
    72
    28
    Jun 30, 2017
    Ratings:
    +116
    Local Time:
    5:48 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Would it be possible to let the user choose what exactly is backed up? Say, if I only want the sql and public folder backed up instead of vhost/etc or if I only want the sql file itself backed up.

    And @eva2000 would your centminmod updates ever break this script?

    I'd also recommend updating the screenshot from the first post because people don't read all of the posts in long threads (which can happen to this one). You've added support for both S3 and Google Drive.
     
  9. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:48 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    break probably not - worse probably would be me adding new locations/directory paths which this backscript may not be aware of i suppose
     
  10. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    I dont have edit option available to add again the option available in the script.
     
  11. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:48 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    you mean editing 1st post of this thread ?
     
  12. Dnyan

    Dnyan Member

    95
    19
    8
    Sep 16, 2017
    Ratings:
    +26
    Local Time:
    2:18 PM
    1.17.8
    10.3.22
    Yes in order to update the screen shots and details of option added and its usage details.
    He requires able to edit the first post of his thread so that, he can update the progress made so far by him on this script.
     
  13. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    yes
     
  14. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:48 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  15. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    Nah its fine here
     
  16. Mak Adang

    Mak Adang Member

    62
    20
    8
    Jan 4, 2015
    Ratings:
    +23
    Local Time:
    3:48 PM
    1.9.0
    10.0.18-MariaDB
    Thank for your script @brijendrasial
    please share command to make backup for google drive, this option show up on first use but next i run the script the option for backup not show up.

    Update: it solved now, before i not set up ( Backup Path: ) /usr/local/src/centminmod_backup/backup_path.conf
     
    Last edited: Sep 5, 2019
  17. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    Great to know you are using it. Any issue or enhancement let me know.
     
  18. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    Backup retention period added.

    MAX_BACKUPS=5
    BACKUP_PATH_DEFINED=/home/centminmodbackup
     
  19. Simon Brown

    Simon Brown Premium Member Premium Member

    51
    5
    8
    Feb 9, 2017
    Ratings:
    +17
    Local Time:
    9:48 AM
    1.11.9
    This is great. Thanks for all your hard work.
    I have a couple of suggestions which stopped the script from working for me and I'm guessing other people too. I'm using the script to migrate Wordpress websites from one server to another.
    1. I have SSH on all my servers set to a non-standard port. An option to add a custom port after entering the destination IP would be good.
    2. I always setup Wordpress to use a subdirectory for security reasons. Is there a way for the script to check the standard Wordpress structure and /*/?
      The Wordpress index.php is at the root, but it points to a subdirectory:
      /public/index.php
      /public/custom-name/wp-content/
    3. It would be great to add multiple sites to the migration at the same time.
     
  20. brijendrasial

    brijendrasial Active Member

    125
    94
    28
    Mar 21, 2018
    Ratings:
    +148
    Local Time:
    2:18 PM
    1.13.9
    10.0.22-MariaDB
    Thanks for head up I will make changes it to.