FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
AIWB
AIWBbackupSQLiteDB_cron
Public
Like
backupSQLiteDB_cron
Home
Code
2
README.md
C
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
README.md

Database Backup Cron Script

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.

Overview

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.

Main Function: handleBackup

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.

Imported Function

The script relies on the backupDatabase function imported from:

import backupDatabase from "https://esm.town/v/AIWB/backupSQLiteDB";
Cron
  • main.tsx
Code
README.md
C
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.