Backup scripts for Code Laundry GitHub repositories and Google Drive files.
Full backup script that clones and archives all repositories from the code-laundry GitHub organization to Google Drive.
Features:
- Backs up all non-archived repositories
- Clones all branches for each repository
- Creates zip archives preserving git history
- Uploads to Google Drive via rclone
- Auto-installs dependencies (GitHub CLI, rclone) if missing
Usage:
./backup_code_laundry.shIncremental backup script that only backs up repositories with recent commits.
Features:
- Only backs up repositories modified within a configurable time window
- Checks all branches for recent activity
- Configurable lookback period (default: 30 days)
- Force mode to backup all repositories regardless of activity
- Logs with timestamps to
logs/directory
Usage:
./backup_code_laundry_incremental.sh # Backup repos with commits in last 30 days
./backup_code_laundry_incremental.sh -d 7 # Backup repos with commits in last 7 days
./backup_code_laundry_incremental.sh -d 90 # Backup repos with commits in last 90 days
./backup_code_laundry_incremental.sh -f # Force backup all repositoriesOptions:
-d days- Number of days to look back for commits (default: 30)-f- Force backup all repositories (ignore modification check)-h- Show help message
Downloads Google-native files (Docs, Sheets, Slides, Drawings) from the CodeLaundry/Offerte folder on Google Drive, converts them to portable formats, and creates a zip archive.
Features:
- Scans the
CodeLaundry/Offertefolder for Google-native files - Lists all found files with their conversion formats
- Asks for confirmation before downloading
- Converts files to portable formats:
- Google Sheets →
.xlsx - Google Docs →
.docx+.pdf - Google Slides →
.pptx+.pdf - Google Drawings →
.png+.pdf
- Google Sheets →
- Preserves folder structure from Google Drive
- Creates timestamped zip archive in the
drive/folder - Shows summary of archived files by type
- Logs with timestamps to
logs/directory
Usage:
./backup_google_files.shOutput:
- Zip archive:
drive/google_files_backup_YYYY-MM-DD_HH-MM-SS.zip
- macOS or Linux
- GitHub CLI (
gh) - auto-installed if missing - rclone - auto-installed if missing
- Python 3 (for
backup_google_files.sh) - Google Drive access configured in rclone as
gdrive
Backups are stored in Google Drive at: CodeLaundry/Cloud Backups/GitHub
Logs are written to the logs/ directory with timestamps.