Script Kit Logo
Script Kit
by John Lindquist

Scripts by shyagamzo

Scheduled Folder Backup

shyagamzo's avatar
Shy Agam
// Schedule: 0 0 */2 * *
// Name: Scheduled Folder Backup
// Description: Incrementally backup a folder to an external SSD every 2 days using rsync.
import "@johnlindquist/kit"
try {
// 1. Prompt the user to select the source folder for backup
const sourceFolder = await path({
hint: "Select folder to backup:",
onlyDirs: true,
});
if (!sourceFolder) {
notify("Backup cancelled: Source folder not selected.");
exit(); // Exit the script if no source folder is selected
return;
}
// 2. Prompt the user to select the destination folder on the external SSD
34 lines below • View full script