AI Insights
Generate a summary and suggested tags for this post.
Meski Google Sheets jauh lebih aman dari Excel di komputer lokal, bukan berarti file kamu kebal dari kehilangan data. Sudah banyak cerita "kolaborator tidak sengaja hapus 500 baris", "rumus VLOOKUP tiba-tiba jadi #REF!", atau bahkan file dihapus permanen dari Trash setelah 30 hari.
Solusinya: backup otomatis — copy spreadsheet ke folder Drive tiap hari, tanpa harus buka file.

Kenapa Backup Otomatis Wajib?
| Risiko | Backup Bantu Karena |
|---|---|
| File terhapus dari Trash > 30 hari | Punya salinan di folder khusus |
| Rumus rusak karena edit sembarangan | Bisa pulihkan versi hari kemarin |
| Kolaborator overwrite baris penting | Bandingkan dengan backup terakhir |
| Serangan phishing / akun dibajak | Backup di folder terpisah bisa direstore |
| Migrasi Sheets ke Excel offline | File .xlsx sudah ada di Drive |
Langkah 1: Buat Folder Backup Khusus
Di Google Drive, buat folder baru bernama "Backup Otomatis". Catat ID folder dari URL:
drive.google.com/drive/folders/**ID_FOLDER**
Langkah 2: Tulis Script Backup
Buka file Sheets yang mau di-backup → Extensions → Apps Script → paste:
const FOLDER_BACKUP = "ID_FOLDER_DRIVE"; // ganti dengan ID folder kamu
const MAX_HARI = 30; // simpan max 30 hari terakhir
function backupSheets() {
const source = SpreadsheetApp.getActiveSpreadsheet();
const folder = DriveApp.getFolderById(FOLDER_BACKUP);
const today = Utilities.formatDate(new Date(), "GMT+7", "yyyy-MM-dd");
const name = `Backup-${source.getName()}-${today}`;
// Copy file ke folder backup
DriveApp.getFileById(source.getId()).makeCopy(name, folder);
// Hapus backup yang lebih tua dari 30 hari
const files = folder.getFiles();
const batas = new Date();
batas.setDate(batas.getDate() - MAX_HARI);
while (files.hasNext()) {
const f = files.next();
if (f.getDateCreated() < batas) f.setTrashed(true);
}
}Klik Save → Run. Setujui akses Drive. Selesai — 1 copy file muncul di folder backup dengan format:
Backup-NamaFile-2025-05-20
Langkah 3: Pasang Trigger Harian

Supaya backup jalan otomatis setiap malam:
- Editor Apps Script → ikon ⏰ Triggers → Add Trigger.
- Function:
backupSheets. - Event source: Time-driven → Day timer → 11pm-12am.
- Save.
Selesai. Tiap malam sebelum tengah malam, script otomatis:
- Copy spreadsheet ke folder backup dengan nama bertanggal.
- Hapus backup yang lebih tua dari 30 hari (biar tidak boros storage).
Strategi Backup: Pilih yang Sesuai

| Strategi | Frekuensi | Retensi | Cocok Untuk |
|---|---|---|---|
| Harian | Setiap hari 23:00 | 30 file | Data transaksi harian, absensi |
| Mingguan | Senin 08:00 | 12 file (3 bulan) | Laporan kerja, database klien |
| Bulanan | Tanggal 1 pagi | 12 file (1 tahun) | Arsip finance, laporan tahunan |
| Hybrid | Kombinasi ketiganya | 54 file total | Data super-kritis (< 100MB) |
Backup dalam Format Excel (.xlsx)
Kalau butuh file offline (contoh: audit, dikirim ke auditor eksternal), export ke .xlsx:
function backupSheetsAsXlsx() {
const source = SpreadsheetApp.getActiveSpreadsheet();
const folder = DriveApp.getFolderById(FOLDER_BACKUP);
const today = Utilities.formatDate(new Date(), "GMT+7", "yyyy-MM-dd");
const url = `https://docs.google.com/spreadsheets/d/${source.getId()}/export?format=xlsx`;
const blob = UrlFetchApp.fetch(url, {
headers: { Authorization: "Bearer " + ScriptApp.getOAuthToken() }
}).getBlob().setName(`Backup-${today}.xlsx`);
folder.createFile(blob);
}Notifikasi Backup Sukses / Gagal
Untuk memastikan backup benar-benar jalan, tambah email konfirmasi:
function backupWithNotif() {
try {
backupSheets();
GmailApp.sendEmail("admin@perusahaan.com",
"✅ Backup Sukses", `Backup harian selesai jam ${new Date()}`);
} catch (err) {
GmailApp.sendEmail("admin@perusahaan.com",
"❌ Backup GAGAL", `Error: ${err.message}`);
}
}Tips Penting
- Jangan backup ke folder yang sama dengan file asli — kalau folder utama di-share dan di-hapus, backup ikut hilang.
- Batas storage Drive gratis: 15 GB — kalau file besar, jangan simpan 100 backup.
- Pertimbangkan external backup — sync folder backup ke Dropbox/OneDrive untuk redundansi.
- Test restore sesekali — backup yang tidak pernah dites bisa corrupt tanpa disadari.
Kesimpulan
Sekali setup 15 menit, kamu punya sistem backup otomatis dengan level enterprise:
- ✅ Copy harian ke folder khusus
- ✅ Auto-rotate (hapus file > 30 hari)
- ✅ Notifikasi email sukses/gagal
- ✅ Fleksibel: harian, mingguan, atau bulanan
- ✅ Bisa export ke .xlsx untuk offline
Data kantor sepenting jantung bisnis — jangan sampai kolaborator ceroboh atau bug tidak sengaja bikin kamu kehilangan berbulan-bulan data. 🛡️
