Join the community today
Register Now

Beta Branch update tools/nginx-binary-backup.sh in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Aug 5, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    11:37 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  2. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    11:37 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    example as outlined at https://community.centminmod.com/th...-backup-restore-nginx-binary-backup-sh.15433/, tools/nginx-binary-backup.sh allows you to backup, restore and list nginx binary backups without having to run centmin.sh menu option 4 for lengthy recompile times. Great for testing different nginx binary optimisations done at compile time etc :)
    Code (Text):
    tools/nginx-binary-backup.sh backup
    --------------------------------------------------------
    backup current Nginx binary and dynamic modules
    --------------------------------------------------------
    backup started...
    --------------------------------------------------------
    /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-210124-cfzlib-lto
    +-- bin
    |   +-- nginx
    +-- dynamic-modules.conf
    +-- dynamic-modules-includes.conf
    +-- modules
        +-- ndk_http_module.so
        +-- ngx_http_brotli_filter_module.so
        +-- ngx_http_brotli_static_module.so
        +-- ngx_http_echo_module.so
        +-- ngx_http_fancyindex_module.so
        +-- ngx_http_geoip2_module.so
        +-- ngx_http_headers_more_filter_module.so
        +-- ngx_http_image_filter_module.so
        +-- ngx_http_modsecurity_module.so
        +-- ngx_http_set_misc_module.so
        +-- ngx_http_vhost_traffic_status_module.so
        +-- ngx_stream_geoip2_module.so
        +-- ngx_stream_js_module.so
    
    2 directories, 16 files
    backup finished...
    --------------------------------------------------------
    backup created at /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-210124-cfzlib-lto
    --------------------------------------------------------
    

    list backups
    Code (Text):
    tools/nginx-binary-backup.sh list
    --------------------------------------------------------
    Listing of available Nginx binary/module backups
    --------------------------------------------------------
    /home/backup-nginxbin/1.17.0-gcc-9.1.0-(GCC)-openssl-1.1.1b-030519-234656-cfzlib
    /home/backup-nginxbin/1.17.0-gcc-9.1.0-(GCC)-openssl-1.1.1b-150519-090318-cfzlib
    /home/backup-nginxbin/1.17.0-gcc-9.1.0-(GCC)-openssl-1.1.1c-290519-194500-cfzlib
    /home/backup-nginxbin/1.17.0-gcc-9.1.1-20190601-openssl-1.1.1c-050619-042613-cfzlib
    /home/backup-nginxbin/1.17.1-gcc-9.1.1-20190615-openssl-1.1.1c-170619-085927-cfzlib
    /home/backup-nginxbin/1.17.1-gcc-9.1.1-20190615-openssl-1.1.1c-250619-191137-cfzlib
    /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto
    /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-205721-cfzlib-lto-fat-lto
    /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-210124-cfzlib-lto
    --------------------------------------------------------
    

    The last 3 backups I made are for one with lto, lto + lto-fat-lto, and lto + lto-no-fat-lto.

    Restoring backup for /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto
    Code (Text):
    tools/nginx-binary-backup.sh restore /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto
    --------------------------------------------------------
    Restore Nginx binary/module from backups
    --------------------------------------------------------
    --------------------------------------------------------
    backup current Nginx binary and dynamic modules
    --------------------------------------------------------
    backup started...
    backup finished...
    --------------------------------------------------------
    backup created at /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-210610-cfzlib-lto
    --------------------------------------------------------
    
    restoring...
    
    cp -af /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto/bin/nginx /usr/local/sbin/nginx
    -rwxr-xr-x 1 root root 4.9M Aug  4 20:41 /usr/local/sbin/nginx
    
    cp -af /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto/modules /usr/local/nginx
    total 6.1M
    drwxr-xr-x.  2 root root 4.0K Aug  4 20:47 .
    drwxr-xr-x. 14 root root 4.0K Aug  4 21:06 ..
    -rwxr-xr-x   1 root root 104K Aug  4 20:41 ndk_http_module.so
    -rwxr-xr-x   1 root root  97K Aug  4 20:41 ngx_http_brotli_filter_module.so
    -rwxr-xr-x   1 root root  90K Aug  4 20:41 ngx_http_brotli_static_module.so
    -rwxr-xr-x   1 root root 531K Aug  4 20:41 ngx_http_echo_module.so
    -rwxr-xr-x   1 root root 114K Aug  4 20:41 ngx_http_fancyindex_module.so
    -rwxr-xr-x   1 root root 103K Aug  4 20:30 ngx_http_geoip2_module.so
    -rwxr-xr-x   1 root root 222K Aug  4 20:41 ngx_http_headers_more_filter_module.so
    -rwxr-xr-x   1 root root 107K Aug  4 20:41 ngx_http_image_filter_module.so
    -rwxr-xr-x   1 root root 291K May 28 19:24 ngx_http_modsecurity_module.so
    -rwxr-xr-x   1 root root 642K Aug  4 20:41 ngx_http_set_misc_module.so
    -rwxr-xr-x   1 root root 923K Aug  2 22:36 ngx_http_vhost_traffic_status_module.so
    -rwxr-xr-x   1 root root  75K Aug  4 20:30 ngx_stream_geoip2_module.so
    -rwxr-xr-x   1 root root 2.9M Aug  2 22:36 ngx_stream_js_module.so
    
    cp -af /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto/dynamic-modules.conf /usr/local/nginx/conf/dynamic-modules.conf
    -rw-r--r-- 1 root root 630 Aug  4 20:40 /usr/local/nginx/conf/dynamic-modules.conf
    
    cp -af /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto/dynamic-modules-includes.conf /usr/local/nginx/conf/dynamic-modules-includes.conf
    -rw-r--r-- 1 root root 0 Apr  9  2017 /usr/local/nginx/conf/dynamic-modules-includes.conf
    --------------------------------------------------------
    Restored Nginx binary/module from
    /home/backup-nginxbin/1.17.2-gcc-9.1.1-20190706-openssl-1.1.1c-040819-204742-cfzlib-lto-no-fat-lto
    --------------------------------------------------------
    nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    
    ngxreload
    Reloading nginx configuration (via systemctl):             [  OK  ]
    --------------------------------------------------------