Support

Akeeba Backup for Joomla!

#30966 – Subdirectories

Posted in ‘Akeeba Backup for Joomla!’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 18 February 2019 20:23 CST
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!
Custom Fields
Joomla! version (in x.y.z format) 3.9.3
PHP version (in x.y.z format) 7.1.0
Akeeba Backup version (x.y.z format) 6.4.0
 
rosendo@discoverwebsolutions.com
Tuesday, 19 February 2019 10:22 CST
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



Please keep in mind my timezone and cultural differences when reading my replies. Thank you!



tampe125
Tuesday, 19 February 2019 13:17 CST
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);
}
}
}
 
rosendo@discoverwebsolutions.com
Wednesday, 20 February 2019 01:52 CST
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



Please keep in mind my timezone and cultural differences when reading my replies. Thank you!



tampe125
Friday, 22 March 2019 18:17 CDT
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.
system
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

Support Information

Working hours: Typically we work Monday to Friday, 9am to 7pm Cyprus timezone (EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets, but we cannot respond to them, outside of our working hours.

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!

Cookies Notification - Action required

This website uses cookies to provide user authentication and improve your user experience. Please indicate whether you consent to our site placing these cookies on your device. You can change your preference later, from the controls which will be made available to you at the bottom of every page of our site.