[SOLVED] How to change the frequency of Backup in Dropbox

Currently only daily or weekly backups are taken.
You can achieve half day backups with custom app and hooks.

For simple workaround use the following code,

Add this to
Setup > Custom Script > New
Doctype : Dropbox Backup
Script :

frappe.ui.form.on("Dropbox Backup", "refresh", function(frm){
	if(frm.doc.send_backups_to_dropbox){
		frm.add_custom_button(__("Take Backup"), function() {
			frappe.call({
				method: "frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_dropbox",
				freeze: true,
				freeze_message: __("Taking backup"),
				callback: function(r){
					if(!r.exc) {
						frappe.msgprint(__("Backup taken successfully"));
					} else {
						frappe.msgprint(__("Error while taking backup. <br /> " + r.exc));
					}
				}
			});
		})	
	}
});

If everything is configured right you should see a button on Dropbox Backup form.

3 Likes