Skip to content

code-laundry/codelaundry-cloud-backup

Repository files navigation

codelaundry-cloud-backup

Backup scripts for Code Laundry GitHub repositories and Google Drive files.

Scripts

backup_code_laundry.sh

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.sh

backup_code_laundry_incremental.sh

Incremental 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 repositories

Options:

  • -d days - Number of days to look back for commits (default: 30)
  • -f - Force backup all repositories (ignore modification check)
  • -h - Show help message

backup_google_files.sh

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/Offerte folder 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
  • 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.sh

Output:

  • Zip archive: drive/google_files_backup_YYYY-MM-DD_HH-MM-SS.zip

Requirements

  • 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

Configuration

Backups are stored in Google Drive at: CodeLaundry/Cloud Backups/GitHub

Logs are written to the logs/ directory with timestamps.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages