backupSQLiteDB_cron
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This cron script is designed to automatically backup specific database tables using the backupSQLiteDB
function. It groups tables and stores them as blobs for easy retrieval and management.
The script imports a backupDatabase
function from an external module and uses it to perform regular backups of specified database tables. It's set up as a cron job to run at scheduled intervals, ensuring your database is consistently backed up.
The handleBackup
function is the core of this script. It takes the following parameters:
DATABASE_PREFIX
(string): The prefix used for the database tables.DATABASE_TABLES
(string[]): An array of table names to be backed up.DATABASE_SUFFIX
(string, optional): A suffix to be added to the database names.
The script relies on the backupDatabase
function imported from:
import backupDatabase from "https://esm.town/v/AIWB/backupSQLiteDB";
Cron