{"id":14980432,"url":"https://github.com/zarehd/psbackuputil","last_synced_at":"2025-07-05T05:35:36.466Z","repository":{"id":152118863,"uuid":"240635286","full_name":"ZarehD/PSBackupUtil","owner":"ZarehD","description":"Make Full \u0026 Partial Disk-to-Disk Archives.","archived":false,"fork":false,"pushed_at":"2023-12-17T02:53:48.000Z","size":166,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T20:11:27.344Z","etag":null,"topics":["archive","backup","powershell","powershell-core"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/PsBackupUtil","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZarehD.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-15T02:55:24.000Z","updated_at":"2023-11-01T00:08:04.000Z","dependencies_parsed_at":"2023-12-17T03:46:35.622Z","dependency_job_id":null,"html_url":"https://github.com/ZarehD/PSBackupUtil","commit_stats":{"total_commits":63,"total_committers":2,"mean_commits":31.5,"dds":"0.17460317460317465","last_synced_commit":"b4f38d26ab49436e3f97091ba4ef251cbf910c1b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZarehD%2FPSBackupUtil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZarehD%2FPSBackupUtil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZarehD%2FPSBackupUtil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZarehD%2FPSBackupUtil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZarehD","download_url":"https://codeload.github.com/ZarehD/PSBackupUtil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238743891,"owners_count":19523195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archive","backup","powershell","powershell-core"],"created_at":"2024-09-24T14:01:46.195Z","updated_at":"2025-07-05T05:35:36.456Z","avatar_url":"https://github.com/ZarehD.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Platform](https://img.shields.io/badge/Platform-PowerShell%20|%20PowerShellCore-svg?color=blue)\n\u0026nbsp;\n[![GitHub](https://img.shields.io/github/license/zarehd/psbackuputil?color=darkgreen\u0026label=License)](https://zarehd.mit-license.org/)\n\n\u003cspan align=\"center\"\u003e\n   \u003cimg src=\"https://github.com/ZarehD/PSBackupUtil/blob/master/logo.png\" width=\"256\" /\u003e\n\u003c/span\u003e\n\n# PSBackupUtil\n\nUtility for archiving files from a specified folder (excluding any specified subfolders, files, or file types), creating Full backups every N days, and Partial backups in between.\n\nEach time the module is executed (Backup-FolderContents), it determines whether a Full or Partial backup should be performed based on the date/time and type (full/partial) of the last backup.\n\n#### Full Backups\n- Created when no previous full backup exists, otherwise every N days ($FullBackupInterval)\n- Created only if there is at least one changed file since the last full backup\n- Archives ALL eligible (not excluded) files, regardless of their last change date/time\n\n#### Partial Backups\n- Created in the interim time between full backups\n- Archives only files changed since the last (full or partial) backup\n\n\u003e #### NOTE: The archive operation will fail if files are read-locked (i.e. in use).\n\n## Installation\n\n\u003e #### PsBackupUril has no external dependencies!\n\n### From Powershell Gallery (recommended)\n```powershell\nPS\u003e Install-Module -Name PsBackupUtil\n```\n\nTo make the module available whenever you open a  PS prompt:\n- Modify the PowerShell profile script, _Microsoft.PowerShell_profile.ps1_ (in `C:\\Users\\\u003cuser\u003e\\Documents\\PowerShell`. Create the file if it doesn't exist).\u003cbr/\u003e\n- Add the following line to the file:\n  ```\n  Import-Module C:\\path\\to\\BackupUtil\\BackupUtil.psd1 -Force\n  ```\n\n## Using the Module\nTo archive a preset group of folders, create a script that uses the module to backup folders (_see **Samples** section below_).\nTo run the archive script on a schedule, create a scheduled task (e.g. Windows Scheduler, cron job, etc.) to run your backup script (e.g. daily or after you login each day).\n\n\n## Archive Name\nThe archive files are compressed Zip files, named using the following convention:\n\n`\u003cbase-name\u003e-\u003cyyyy\u003e-\u003cMM\u003e-\u003cdd\u003e-\u003cHH\u003e-\u003cmm\u003e-\u003css\u003e[-\u003carchive-mode-marker\u003e].\u003cextension\u003e`\n\n- `Base-Name ::= User specified, or if unspecified, name of source folder to be archived. NOTE: Any '-' char in the base name will be replaced with '_'`\n- `y, M, d, H, m, s ::= Component parts of the current date/time (in 24-hour format)`\n- `Archive-Mode-Marker ::= 'Full' | 'Part' | \u003cblank\u003e`\n- `Extension ::= User sepcified (default: 'zip')`\n\n\n## Parameters\nParameter                |Required |Data Type    |Default |Description\n:------------------------|:--------|:------------|:-------|:---------------------------------\n$BaseName                |         |string       | Name of folder specified in $SourceFolder | The Base Name for the archive file\n$SourceFolder            | True    |string       |       | Path to folder containing files to be backed up\n$DestinationFolder       | True    |string       |       | Path to folder where archive file for the backup will be placed\n$Extension               |         |string       |'zip'  | Archive file extension\n$FullBackupInterval      |         |int          |7      | Number of days between full backups\n$RemovePartialsAfterFull |         |bool         |False  | Remove prior period partial backup file(s) after creating a full-backup. CURRENTLY NOT IMPLEMENTED\n$FullBackupMarker        |         |string       |'Full' | Marker text to use for Full backup archive names\n$PartialBackupMarker     |         |string       |'Part' | Marker text to use for Partial backup archive names\n$IgnoreFolders           |         |string array |       | Names of folders to omit from the backup\n$IgnoreFileTypes         |         |string array |       | File types (ex: '*.zip') to omit from the backup\n$IgnoreFiles             |         |string array |       | Names of specific files (name \u0026 extension, no path) to omit from the backup\n\n\n## Samples\n\nHere's a sample script that uses the module to backup project files.\n\n#### MyBackupScript.ps1\n```powershell\n##Requires -Module BackupUtil\n\n\n$project = \"MySampleProject\"\n$srcRoot = Join-Path \"C:\\Projects\" $project\n$dstRoot = Join-Path \"D:\\Archives\\Projects\" $project\n\n\n#----------------------------------------------------------------------------------------------------------\n# backup project source code...\n$FoldersToIgnore = @(\n    \"obj\", \"bin\", \".vs\", \".git\",\n    \"packages\", \"node_modules\", \"wwwroot\"\n)    \n$FileTypesToIgnore = @(\"*.zip\", \"*.user\", \"*.msi\")\n$FilesToIgnore = @()\n\n$nam = \"ProjectCode\"\n$dir = \"src\"\n$src = Join-Path $srcRoot $dir\n$dst = Join-Path $dstRoot $dir\n\nBackup-FolderContents `\n    -BaseName = $nam `                      # the base name of the archive file (SourceFolder folder name used if omitted)\n    -SourceFolder $src `                    # root folder containing files that will be backed up\n    -DestinationFolder $dst `               # root folder where archived files will be backed up to\n    -FullBackupInterval 10 `                # number of days between full backups\n    -IgnoreFolders $FoldersToIgnore `       # list of folders to ignore (not backup)\n    -IgnoreFileTypes $FileTypesToIgnore `   # List of file types to ignore (not backup)\n    -IgnoreFiles $FilesToIgnore `           # List of specific files to ignore (not backup)\n    -Verbose -Debug\n\n\n#----------------------------------------------------------------------------------------------------------\n# backup project docs...\n$FoldersToIgnore = @()\n$FileTypesToIgnore = @()\n$FilesToIgnore = @()\n\n$nam = \"ProjectDocs\"\n$dir = \"docs\"\n$src = Join-Path $srcRoot $dir\n$dst = Join-Path $dstRoot $dir\n\nBackup-FolderContents `\n    -BaseName = $nam `                      # the base name of the archive file (SourceFolder folder name used if omitted)\n    -SourceFolder $src `                    # root folder containing files that will be backed up\n    -DestinationFolder $dst `               # root folder where archived files will be backed up to\n    -FullBackupInterval 10 `                # number of days between full backups\n    -IgnoreFolders $FoldersToIgnore `       # list of folders to ignore (not backup)\n    -IgnoreFileTypes $FileTypesToIgnore `   # List of file types to ignore (not backup)\n    -IgnoreFiles $FilesToIgnore `           # List of specific files to ignore (not backup)\n    -Verbose -Debug\n```\n\n## License\n[MIT](https://zarehd.mit-license.org/) [License](https://github.com/ZarehD/PSBackupUtil/blob/master/LICENSE)\n\nIf you like this project, or find it useful, please give it a star. Thank you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarehd%2Fpsbackuputil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzarehd%2Fpsbackuputil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzarehd%2Fpsbackuputil/lists"}