Get the most out of your Centmin Mod LEMP stack
Become a Member

Sysadmin What's eating up my SSD space (resolved --> Manual delete)

Discussion in 'System Administration' started by EckyBrazzz, Jun 6, 2019.

  1. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    1:24 AM
    1.17.x
    10.3.x
    I noticed that my snapshots where growing day by day, so tried to track down what caused it. And yes, found it. Good to have backup, but may "old" once are quite useless.

    Maybe an Idea to create something that tars them to save to space, the same as with log rotation.
    Code (Text):
    du -x -d1 -h /usr/local  | sort -hr   
    6.6G    /usr/local
    5.3G    /usr/local/nginxbackup
    707M    /usr/local/nginx
    228M    /usr/local/modsecurity
    134M    /usr/local/bin
    97M     /usr/local/lib
    63M     /usr/local/src
    55M     /usr/local/sbin
    12M     /usr/local/maldetect.bk7265
    8.1M    /usr/local/maldetect.bk20553
    7.8M    /usr/local/maldetect
    7.0M    /usr/local/include
    6.9M    /usr/local/lib64
    6.4M    /usr/local/share
    3.0M    /usr/local/csf
    372K    /usr/local/zlib-cf
    96K     /usr/local/etc
    72K     /usr/local/php
    12K     /usr/local/man
    4.0K    /usr/local/var
    0       /usr/local/libexec
    


    After some cleaning up it looked a lot better, I don't need those for the first of April as backup for example
    Code (Text):
    du -x -d1 -h /usr/local  | sort -hr
    1.7G    /usr/local
    707M    /usr/local/nginx
    336M    /usr/local/nginxbackup
    228M    /usr/local/modsecurity
    134M    /usr/local/bin
    97M     /usr/local/lib
    63M     /usr/local/src
    55M     /usr/local/sbin
    12M     /usr/local/maldetect.bk7265
    8.1M    /usr/local/maldetect.bk20553
    7.8M    /usr/local/maldetect
    7.0M    /usr/local/include
    6.9M    /usr/local/lib64
    6.4M    /usr/local/share
    3.0M    /usr/local/csf
    372K    /usr/local/zlib-cf
    96K     /usr/local/etc
    72K     /usr/local/php
    12K     /usr/local/man
    4.0K    /usr/local/var
    0       /usr/local/libexec
    0       /usr/local/games
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,375
    9,288
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,251
    Local Time:
    2:24 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Each time you upgrade Nginx an auto backup of nginx conf files and ssl directories is generated. See http://centminmod.com/nginx.html#autobackup and http://centminmod.com/configfiles.html. So if you don't need such backups, you can disable via setting NGINXBACKUP='n' variable in persistent config file /etc/centminmod/custom_config.inc
    So if you accidentally deleted your Nginx vhost files at /usr/local/nginx/conf/conf.d/ and/or SSL files at /usr/local/nginx/conf/ssl/ you can restore a previous copy from /usr/local/nginxbackup which has 2 directories
    1. /usr/local/nginxbackup/confbackup which is backup for everything within /usr/local/nginx/conf including subdirectories like /usr/local/nginx/conf/conf.d/
    2. /usr/local/nginxbackup/nginxdirbackup which is backup for everything within /usr/local/nginx/ including subdirectories
    Code (Text):
    ls -lah /usr/local/nginxbackup
    total 32K
    drwxr-xr-x.   4 root root 4.0K Apr  4  2017 .
    drwxr-xr-x.  22 root root 4.0K Sep  9 05:27 ..
    drwxr-xr-x. 212 root root  12K Nov 20 00:25 confbackup
    drwxr-xr-x. 212 root root  12K Nov 20 00:25 nginxdirbackup
    

    So for instance for backup dated 310817 = 31 August, 2017 at /usr/local/nginxbackup/confbackup/conf_310817-005457/conf.d/ would have Nginx vhost config files which were backed up from /usr/local/nginx/conf/conf.d/
    Code (Text):
    ls -lah /usr/local/nginxbackup/confbackup/conf_310817-005457/conf.d/
    
    -rw-r--r--  1 root root 1.1K Aug 30 18:55 demodomain.com.conf
    -rw-r--r--  1 root root 2.0K Aug 30 18:55 domain1.com.conf
    -rw-r--r--  1 root root 3.3K Aug 30 18:55 domain1.com.ssl.conf
    -rw-r--r--  1 root root  846 Aug 30 18:55 ssl.conf
    -rw-r--r--  1 root root 2.6K Aug 30 18:55 virtual.conf
    

    and /usr/local/nginxbackup/confbackup/conf_310817-005457/ssl would contain the nginx ssl certificate files backed up from /usr/local/nginx/conf/ssl

    So contents of /usr/local/nginxbackup/confbackup/conf_310817-005457/ssl
    Code (Text):
    ls -lah /usr/local/nginxbackup/confbackup/conf_310817-005457/ssl
    
    drwxr-xr-x. 2 root root 4.0K Apr  4  2017 domain1.com
    

    has /usr/local/nginxbackup/confbackup/conf_310817-005457/ssl/domain1.com backups for /usr/local/nginx/conf/ssl/domain1.com
    Code (Text):
    ls -lah /usr/local/nginxbackup/confbackup/conf_310817-005457/ssl/domain1.com
    total 40K
    drwxr-xr-x. 2 root root 4.0K Apr  4  2017 .
    drwxr-xr-x. 6 root root 4.0K Jun 23 11:24 ..
    -rw-r--r--. 1 root root  424 Apr  4  2017 dhparam.pem
    -rw-r--r--. 1 root root  952 Apr  4  2017 domain1.com-backup.csr
    -rw-r--r--. 1 root root 1.7K Apr  4  2017 domain1.com-backup.key
    -rw-r--r--. 1 root root 1.1K Apr  4  2017 domain1.com.crt
    -rw-r--r--. 1 root root  952 Apr  4  2017 domain1.com.csr
    -rw-r--r--. 1 root root 1.7K Apr  4  2017 domain1.com.key
    -rw-r--r--. 1 root root   45 Apr  4  2017 hpkp-info-primary-pin.txt
    -rw-r--r--. 1 root root   45 Apr  4  2017 hpkp-info-secondary-pin.txt
    

    So if you don't need such backups, you can disable via setting NGINXBACKUP='n' variable in persistent config file /etc/centminmod/custom_config.inc

    Yes thought about that just how many folks would recognise and know what to do with just a .tar.gz or .tar.xz or .tar.zst compressed file as opposed to just a directory with recognisable directory and file names, they can just copy over and use ?

    Then again how many folks read far enough into Centmin Mod to know that nginx auto backups exist on every nginx centmin.sh menu option 4 run ? So yes compressed backups is probably better option than running out of disk space :)
     
    • Like Like x 1
  3. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    1:24 AM
    1.17.x
    10.3.x
    Use MC (midnight commander). It extracts and you can copy over directly.
     
  4. eva2000

    eva2000 Administrator Staff Member

    41,375
    9,288
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,251
    Local Time:
    2:24 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    most folks wouldn't know what midnight commander is either heh
     
  5. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    1:24 AM
    1.17.x
    10.3.x
    Guess I belong to the "Old School" section.
     
  6. eva2000

    eva2000 Administrator Staff Member

    41,375
    9,288
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,251
    Local Time:
    2:24 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah tricky part of developing Centmin Mod LEMP stack is finding a balance for end users base knowledge - between them needing to learn something new or foreign and still giving advance system admin pros the tools to just do their work within SSH command line uninterrupted :)
     
  7. eva2000

    eva2000 Administrator Staff Member

    41,375
    9,288
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,251
    Local Time:
    2:24 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    • Like Like x 1
  8. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    1:24 AM
    1.17.x
    10.3.x
    Like it, the new update to tar gzip compress backups only, disable logs is not a good Idea for bug tracking
     
  9. eva2000

    eva2000 Administrator Staff Member

    41,375
    9,288
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,251
    Local Time:
    2:24 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    didn't disable logs though ?
     
  10. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    1:24 AM
    1.17.x
    10.3.x
    No, so deleted several that where old.
     
    • Informative Informative x 1