Skip to content

Automated PowerShell and batch scripts for backing up development projects, configuration files, and non-committed assets. Includes flexible logging, example usage, and documentation for streamlining backups in Angular, IONIC, and other environments.

License

Notifications You must be signed in to change notification settings

zoechbauer/z-control-Backup-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

z-control Backup & Cleanup Scripts 🚀

Welcome to the z-control Backup & Cleanup Scripts repository!
This project provides a collection of PowerShell and batch scripts to automate and streamline the backup, cleanup, and disk space logging processes for development environments.
Whether you need to back up your code, configurations, or other important files, clean up bulky or unnecessary folders, or monitor and analyze disk usage across your projects, these scripts provide a robust and flexible foundation.

Note:
While most projects are committed to GitHub or another backup service, these scripts are especially useful for simple tests, examples, or temporary projects. They help you remove unwanted large folders (such as dependencies and build outputs), copy a lean version of your projects to a folder synchronized with a service like OneDrive, clean up seldom-used dev projects, and audit disk space usage.


📁 Project Structure

backup-scripts/
│
├── README.md
├── LICENSE
│
├── docs/
│   ├── Backup Scripts for Development Projects.md
│   ├── Backup Scripts for non committed files.md
│   ├── Cleanup Development Projects Scripts.md
│   ├── Log Disk Space Scripts.md
│   └── Upgrade PowerShell 5 to 7.md
│
├── examples/
│   ├── README.md
│   ├── backup-dev-projects/
│   │   ├── README.md
│   │   ├── scripts/
│   │   │   ├── backup-dev.ps1
│   │   │   ├── backup-dev-task.bat
│   │   ├── logging-examples/
│   │   │   ├── logging-folders-and-files/
│   │   │   │   ├── BACKUP.csv
│   │   │   │   └── BACKUP.xlsx
│   │   │   └── logging-folders-only/
│   │   │       ├── BACKUP.csv
│   │   │       └── BACKUP.xlsx
│   │   └── parameter-examples/
│   │       └── terminal-log.txt
│   ├── backup-non-committed-project-files/
│   │   ├── calculator/
│   │   │   └── tools/
│   │   │       ├── backup_non_committed_files.ps1
│   │   │       ├── backup_non_committed_files.txt
│   │   │       └── README.md
│   │   └── z-control landing-page/
│   │       └── tools/
│   │           ├── backup_non_committed_files.ps1
│   │           ├── backup_non_committed_files.txt
│   │           └── README.md
│   ├── clean-dev-projects/
│   │   ├── cleanup-dev.ps1
│   │   ├── cleanup-dev-task.bat
│   │   └── README.md
│   └── log-disk-space/
│       ├── README.md
│       ├── log-folder-sizes.bat
│       ├── log-folder-sizes.ps1
│       ├── example-one-project-unlimited-subfolders/
│       │   ├── terminal-log.txt
│       │   ├── FolderSizesLog.csv
│       │   ├── FolderSizesLog.txt
│       │   └── FolderSizesLog.xlsx
│       └── example-source-active-searchDepth-2/
│           ├── terminal-log.txt
│           ├── FolderSizesLog.csv
│           ├── FolderSizesLog.txt
│           └── FolderSizesLog.xlsx

🚀 Getting Started

Prerequisites

  • Microsoft PowerShell (Windows)
  • Optionally, Windows Task Scheduler for automated backups and cleanups

Installation

# Clone the repository
git clone https://github.com/zoechbauer/backup-scripts.git
cd backup-scripts

# Create a scheduled task or run scripts manually

🛠️ Tech Stack

  • Microsoft PowerShell: Primary scripting language
  • Batch Scripting: For Windows task automation

📖 Documentation

All documentation lives in docs/:

  • Backup Scripts for Development Projects:
    Guide for backing up entire development projects, especially Angular and IONIC projects.
    Includes usage of backup-dev.ps1 and backup-dev-task.bat, logging options, and customization for excluded folders.

  • Backup Scripts for non committed files:
    Guide for backing up files and folders not typically committed to version control (e.g., .github, .vscode, .env.local).
    Includes usage for example projects like Calculator and z-control landing-page.

  • Cleanup Development Projects Scripts:
    Guide for cleaning up dev project folders by deleting bulky or unnecessary directories (like node_modules, www, dist, .angular) and logging the results.
    Includes usage of cleanup-dev.ps1 and cleanup-dev-task.bat, logging options, and scheduling tips.

  • Log Disk Space Scripts:
    Guide for logging disk space usage, including usage instructions, script details, and example outputs.

  • Upgrade PowerShell 5 to 7:
    Step-by-step instructions for upgrading from Windows PowerShell 5.1 to PowerShell 7, including integration with VS Code and scheduled tasks.

📝 Features

  • Recursively back up project folders and files
  • Exclude common build and dependency folders (customizable)
  • Log processed items to CSV (folders only or folders and files)
  • Example scripts for non-committed files
  • Clean up dev projects by deleting large or unnecessary folders (e.g., node_modules, www, dist, .angular)
  • Log all deleted folders and (optionally) files to CSV for audit
  • Ready for scheduled automation via batch files (for both backup and cleanup)
  • Log disk space usage for any disk drive or directory, with flexible depth and output formats (CSV, Excel-ready)
  • Example logs and Excel files for disk usage analysis

Scheduled Task

  • You can use all batch scripts in a Windows Scheduled Task to automate backups.
  • Set the task to run the batch file at your preferred schedule.
  • Ensure the user account running the task has permission to access the source and backup directories.

📝 License

This project is open source and available under the MIT License.

📧 Contact

Hans Zöchbauer

If you have questions, need support, or want to contribute, feel free to reach out via email or open an issue on GitHub.


Last Updated: December 14, 2025

About

Automated PowerShell and batch scripts for backing up development projects, configuration files, and non-committed assets. Includes flexible logging, example usage, and documentation for streamlining backups in Angular, IONIC, and other environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published