Lekhoniya lekhoniya.com Subham Mandal Dhupguri ONE Code ONE ssss web West Bengal India Bangla writing pad Bengali type লেখনীয়া
লেখনীয়া
progarammed by Subham Mandal

Automated Backup Lekhoniya : Safeguarding Your Content

 

Automated Backup Lekhoniya : Safeguarding Your Content

Introduction

Safeguard your content with the Automated Backup script, a creation by the resourceful developer Subham Mandal. Integrated into the web application Lekhoniya, and associated with the brand name onessssweb, this script automates the backup process, ensuring the safety and accessibility of your valuable content.

Overview

Backup Upload

The backupload function orchestrates the backup process by collecting essential information such as the timestamp, backup URL, and backup data.

function backupload() {
    // ... (existing code)

    let timestamp = new Date().toLocaleTimeString() + ' | ' + new Date().getDate() + '-' + ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][new Date().getMonth()] + '-' + new Date().getFullYear();

    let backupurl = document.getElementById("shareurl").value;
    let backupdata = document.getElementById("backupdatax").value;

    document.getElementById('timestamp').value = timestamp;
    document.getElementById('backupurl').value = backupurl;
    document.getElementById('backupdata').value = backupdata;

    backupsheet();
}

Google Sheet Backup

The backupsheet function sends the collected backup information to a Google Sheet for secure storage and easy retrieval.

function backupsheet() {
    const scriptURL = 'https://script.google.com/macros/s/AKfycbyJfX6ypCWnHy5iX6VuJP9yonTmhlbbvwGUxVlozaXvD-k2m6vAbsQZ8-XAPvIvs4cB/exec';
    const form = document.forms['google-sheet'];

    fetch(scriptURL, { method: 'POST', body: new FormData(form) })
        .then(response => {
            if (response.ok) {
                document.getElementById("online").innerHTML = "Server";
                document.getElementById("onlineedit").innerHTML = "Server (Editable)";
            } else {
                alert('Backup failed. Please try again.');
            }
        })
        .catch(error => {
            alert('An error occurred during backup. Please try again later.');
            console.error('Error:', error);
        });
}

Usage Instructions

  1. Backup Content: Utilize the backupload function to initiate the automated backup process.

  2. Google Sheet Storage: The backupsheet function sends the backup information to a Google Sheet for secure storage.

Conclusion

Automated Backup, a creation by the insightful Subham Mandal, adds an extra layer of protection to your Lekhoniya content. Seamlessly integrated with the brand name onessssweb, this script automates the backup process, ensuring the safety and accessibility of your valuable content.

Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements related to this script. Safeguard your content effortlessly with the automated backup feature of Lekhoniya!