Support

Akeeba Backup for Joomla!

#30966 Subdirectories

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Friday, 22 March 2019 18:17 CDT

[email protected]
Please look at the bottom of this page (under Support Policy Summary) for our support policy summary, containing important information regarding our working hours and our support policy. Thank you!

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 2Mb, please upload it on your server and post a link to it.

Description of my issue:

I have set up my back ups to run and upload to Google Drive. I use subdirectories. So I have the following:

/Root Folder/Company Folder

I have set up the following in the Post-processing engine:

/Root Folder/Company Folder/[DATE], [TIME], [HOST], [RANDOM]

I have set the Count quota to 3 and the box for Enable remote file quotas is checked. After the third back up the files inside the oldest folder [DATE], [TIME], [HOST], [RANDOM] are removed, but not the folder. Where do I set this to remove the folder [DATE], [TIME], [HOST], [RANDOM]?

Thanks in advance!

tampe125
Akeeba Staff
Hello,

Google Drive APIs are poor documented and the whole logic behind is very convoluted (case in point: in order to fix an upload issue, we had to do the exact opposite they were saying in their docs).
While uploading files to your Google Drive account, we only get a reference to the backup archive we uploaded, not the whole folder path.
This means that when backup quotas are applied, we delete everything we know of, ie all the backup archives since we have their file id.
Sadly we do not have any point to the full path inside Google Drive, so after deleting the old backups, empty folders are left behind.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

[email protected]
Thanks for the reply. I testing this script for deleting empty folders in Google Drive, and it works. Just go to https://script.google.com. Create a new project, a file, and paste the info below. The script runs for 6 minutes before it times out. I am planning to run it automatically on the first of each month. Hope others find this useful.

Thanks,
Rosendo
www.discoverwebsolutions.com



function delEmptyFolders() {
var folders = DriveApp.getFolders();
var ss = SpreadsheetApp.create("folderslist");
while (folders.hasNext()) {
var folder = folders.next();
var files = folder.getFiles();
var childfolders = folder.getFolders();
var filecount = 0;
var foldercount = 0;
while (childfolders.hasNext()){
var childfolder = childfolders.next();
foldercount ++;
}
while (files.hasNext()){
var file = files.next();
filecount ++;
}
ss.appendRow([folder.getId(),folder.getName(),filecount, foldercount]);
if (filecount == 0 && foldercount == 0){
folder.setTrashed(true);
}
}
}

tampe125
Akeeba Staff
Thank you very much for the suggestion!
We will take a look at it and see if it's possible to implement.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!