Does API func "fullbackup_to_ftp" auto deletes file it generated?
I am trying to figure out a 3rd party script that seems to use this function: https://api.docs.cpanel.net/openapi/cpanel/operation/fullbackup_to_ftp/
Does this function auto deletes the backup file it generated?
-
Hey there! Yes, I tested the call just now and on my end the backups were removed from the local system after they were generated.
1 -
@cPRex Thank you for doing that. Reason I ask is beacuse I notice some backup files that were generated are not deleted automatically -- causing excess disk usage and "disk is full" notifcations.
Would you know the exact criteria that triggers deletion? Like is it triggered after successful FTP transfer? Or, would the delete command potentially fail if the account's disk allocation if full?
0 -
Would you happen to have the name of one of those files? The API call creates files named backup-MM.DD.YYYY_HH-mm-ss.tar.gz so it's a specific file name you'd see if they were abandoned by that call.
With my test, the file was removed either after a failed FTP connection or a completed transfer.
0 -
Yes, the file uses the format backup-MM.DD.YYYY_HH-mm-ss.tar.gz
the file was removed either after a failed FTP connection or a completed transfer.
If that is the case, I assume the delete command possibly fails if the account is overquota because the undeleted backup files seems to be only present on accounts that are overquota.
Do you think this is an expected behavior (API commands such as deletes could fail if account is overquota)?
0 -
I spoke with a developer about how this may fail, and he did say it *could* fail because of a quota issue, but it would be unlikely during the delete portion.
I would try this - could you run the API call on the account experiencing the issue outside of the application and see if that triggers a failure of some sort?
0 -
Thanks. I tested what happens when a cPanel account is over quota—specifically at 101% usage. In that case, the backup doesn't complete. No actual backup file is created, and what's left is a partial file with a name like
backup-MM.DD.YYYY_HH-mm-ss
(without any file extension). It looks like the compression process was interrupted, and the incomplete file isn’t removed.I haven’t yet tested what happens if an account is under quota (around 90%) but goes over during the backup process. My guess is that the backup file probably won’t be deleted in that scenario either.
I'm running the API command as a reseller account. What I’m wondering now is: is it possible to configure the backup to be stored in the home directory of the reseller account, rather than inside each individual cPanel account? That might help avoid this quota issue altogether.
0 -
Thanks for the additional details. I did some more testing on this and my findings agree with yours - if the user is over quota it will stop the backup creation process. I think we just assume that if a user is taking advantage of the API they should know their disk quota, but of course this wouldn't apply to third-party applications or custom scripts.
The same happens if the account goes over quota during the backup run.
I actually just filed a separate case to display a warning message inside the cPanel >> Backup tool telling the user they are close to their quota, but that still wouldn't help with the API.
So - do you think it would be beneficial for the API to fail with a quota error instead?
0 -
Thanks for the additional testing.
The use case for this is the API allows resellers to have their own backups independent of the provider (root). In this case, since the API ran under a reseller account, it should not fail unless the reseller account itself is overquota. On the other hand, if the API is ran under a normal account (non-reseller, non-root), it should error if the individual account is over quota.
As reseller, I think there should be an ability to set the destination dir for these temp backup files. Is this something doable can be requested as feature?
Side question: maybe you know another way for resellers to have their own backups independent of the the provider's?
0
Please sign in to leave a comment.
Comments
8 comments