Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED command line backup - disk quota exceeded

Discussion in 'Workarounds and Optimization' started by Gojko, Jul 18, 2018.

  1. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    i have bash script that make backup of specific account and send file to backup server
    but one account have not space on account and i can't create backup
    Code:
    echo "Creating backup for user $CPUSER.."
                    /usr/local/cpanel/scripts/pkgacct $CPUSER $TEMPPATH userbackup
    but responde from script:

    Code:
    [2018-07-18 06:00:03 +0200] pkgacct started.
    [2018-07-18 06:00:03 +0200] pkgacct version 10 - user : accountuser - tarball: 1 - target mysql : default - split: 0 - incremental: 0 - homedir: 1 - mailman: 1 - backup: 0 - archive version: 4 - running with uid 0
    [2018-07-18 06:00:03 +0200] pkgacct using '/usr/local/cpanel/3rdparty/bin/pigz -6 --processes 1 --blocksize 4096 --rsyncable' to compress archives
    [2018-07-18 06:00:03 +0200] pkgacct working dir : /root/tmp/backup-7.18.2018_06-00-03_accountuser
    [2018-07-18 06:00:03 +0200] Could not close writing to /home/accountuser/backup-7.18.2018_06-00-03_accountuser: Disk quota exceeded
    [2018-07-18 06:00:03 +0200] The subprocess reported error number 1 when it ended. at /usr/local/cpanel/scripts/pkgacct line 503.
    Backup done. Transferring backup to FTP server..
    but i have backup weekly and cpanel make backup normally?
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Gojko

    Is the same error presented when you run the backups? You'd most likely need to look in the backup logs for this. They're located at
    Code:
    /usr/local/cpanel/logs/cpbackup/
    Ultimately this indicates that the user has exceeded their quota to resolve this you'd need to bring them below their quota or increase it.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    Hello i run manually command
    Code:
    /usr/local/cpanel/scripts/pkgacct user /tmp/
    and
    Code:
    Creating Archive ......................................................
    [2018-07-19 16:15:56 +0200] Done
    [2018-07-19 16:15:56 +0200] pkgacctfile is: /tmp/cpmove-user.tar.gz
    [2018-07-19 16:15:59 +0200] md5sum is: f0529506eeed281b9bc175972d14f0d6
    [2018-07-19 16:15:59 +0200]
    [2018-07-19 16:15:59 +0200] size is: 1649300004
    [2018-07-19 16:15:59 +0200]
    [2018-07-19 16:15:59 +0200] homesize is: 10485760000
    [2018-07-19 16:15:59 +0200]
    [2018-07-19 16:15:59 +0200] homefiles is: 48509
    [2018-07-19 16:15:59 +0200] pkgacct completed
    so how is that possible? with bash script don't work?

    also i looked at logs and found the same:

    Code:
    [2018-07-15 02:20:04 +0200] pkgacctfile is: /backups3/weekly/2018-07-15/accounts/user.tar.gz
    [2018-07-15 02:20:04 +0200]
    [2018-07-15 02:20:04 +0200] size is: 1648598094
    [2018-07-15 02:20:04 +0200]
    [2018-07-15 02:20:04 +0200] homesize is: 10485760000
    [2018-07-15 02:20:04 +0200]
    [2018-07-15 02:20:04 +0200] homefiles is: 49032
    [2018-07-15 02:20:04 +0200] pkgacct completed
    so what i'm asking for:
    Code:
    [2018-07-19 06:00:03 +0200] pkgacct version 10 - user : user - tarball: 1 - target mysql : default - split: 0 - incremental: 0 - homedir: 1 - mailman: 1 - backup: 0 - archive version: 4 - running with uid 0
    [2018-07-19 06:00:03 +0200] pkgacct using '/usr/local/cpanel/3rdparty/bin/pigz -6 --processes 1 --blocksize 4096 --rsyncable' to compress archives
    [2018-07-19 06:00:03 +0200] pkgacct working dir : /root/tmp/backup-7.19.2018_06-00-03_user
    [2018-07-19 06:00:03 +0200] Could not close writing to /home/user/backup-7.19.2018_06-00-03_user: Disk quota exceeded
    why trying to write in /home/user/? when i run command manually don't write in home directory of user only on /tmp/ like what i set?
    part of script:

    Code:
     while read -r CPUSER
            do
                    echo "Creating backup for user $CPUSER.."
                    /usr/local/cpanel/scripts/pkgacct $CPUSER $TEMPPATH userbackup
    
                    echo "Backup done. Transferring backup to FTP server.."
                    FILENAME=`ls $TEMPPATH | grep tar.gz`
                    $FTP -n $CHOST <<END_SCRIPT
                    quote USER $CUSERNAME
                    quote PASS $CPASSWORD
                    binary
                    passive
                    cd $LHOSTNAME
                    cd $DANASNJIDATUM
                    lcd $TEMPPATH
                    put $FILENAME
                    quit
    END_SCRIPT
    
            echo "Removing temporary files.."
            rm -Rf $TEMPPATH/backup-*
            USERDIR=`cat /var/cpanel/users/$CPUSER | grep HOMEDIRPATHS | sed 's/HOMEDIRPATHS=//g'`
            rm -Rf $USERDIR/backup-*
            echo "Backup for $CPUSER complete!"
    
    
            done  < "/home/backupspecial/backupfile.txt"
            echo "Process complete!"
            exit 0
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    It's possible to override the partial failure notification and have backups complete successfully, I was unaware of your configuration in that respect, based on what you're providing though it looks like those backups are completing successfully.

    Can you show me the size of tmp? Has this customization ever worked or did it just start failing?

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    It work. I have 2 account on that server and 5 more on other for special backup. And it's work but only this account failed. I checked it's not just log, backup really don't exist. and yes after manually run command backup is created in /tmp/ folder (checked).
    So only when is run trough bash write in home directory.

    I will fill add test account and fill with space to check if other also fail if there is no space on account, but i'm confused why write in home of user at all.
     
  6. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Gojko

    Can you show me the size of /tmp you can do this by running df like so:

    Code:
    df -kh
    Then the size of the completed backup would also be useful.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    Code:
    df -kh
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/md2        438G  143G  273G  35% /
    devtmpfs         32G     0   32G   0% /dev
    tmpfs            32G     0   32G   0% /dev/shm
    tmpfs            32G  962M   31G   4% /run
    tmpfs            32G     0   32G   0% /sys/fs/cgroup
    /dev/md1        488M  281M  182M  61% /boot
    tmpfs           6.3G     0  6.3G   0% /run/user/0
    Code:
    du -h cpmove-user.tar.gz
    1.5G    cpmove-user.tar.gz
    
    edit: one more thing backup file in home user has 0 byte
     
    #7 Gojko, Jul 19, 2018
    Last edited: Jul 19, 2018
  8. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Gojko

    Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    Solved.
    Code:
    /usr/local/cpanel/scripts/pkgacct $CPUSER $TEMPPATH userbackup
    "userbackup" make to backup file put in home directory so i removed and working great
     
  10. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Gojko

    I also wanted to follow up here and note that as a result of the ticket the backup storage did not have enough space for the previous backup run and the current one to exist until the backups were pruned. I'm glad to hear that it's now working for you and that a resolution was found.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    80
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    Backup storage had enough space (874gb free), so your statement it is not correct. On server i have 35% of usage 65% are free space. (Disk usage 1,126 GB / 0 GB / 2,000 GB)
    Problem was parameter like what i wrote. (you can check ticked id: 9955377)
     
    cPanelLauren likes this.
  12. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Gojko

    That's completely my fault, I mistook another ticket for the one you opened here. You're correct the resolution in this instance was to the modify userback option in pkgacct:

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice