Skip to content

Commit aa30aae

Browse files
author
mpb10
committed
Updated README.md and finished setup for release.
1 parent b9cfd33 commit aa30aae

File tree

3 files changed

+60
-19
lines changed

3 files changed

+60
-19
lines changed

README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# PowerShell-Backup-Script
22
https://github.com/mpb10/PowerShell-Backup-Script
33

4-
A PowerShell script used to backup files.
4+
A PowerShell script used to back up files and folders.
55

66

7-
**Author: Matt Bittner**
7+
**Author: mpb10**
88

9-
**May 9th, 2018**
9+
**August 13th, 2018**
1010

1111
**v2.0.0**
1212

@@ -21,12 +21,51 @@ A PowerShell script used to backup files.
2121

2222
# INSTALLATION
2323

24+
**Script download link:** https://github.com/mpb10/PowerShell-Backup/releases/download/v2.0.0/PowerShell-Backup-v2.0.0.zip
25+
26+
**Requires:** PowerShell 5.0 or greater*
27+
28+
*Version 5.0 of PowerShell comes pre-installed with Windows 10 but otherwise can be downloaded here: https://www.microsoft.com/en-us/download/details.aspx?id=50395
29+
30+
#
31+
32+
**To Install:**
33+
34+
1. Ensure that you have PowerShell Version 5.0 or greater installed.
35+
2. Download the release .zip file and extract it to a folder.
36+
3. Run the 'Installer' shortcut located in the `\install` folder (or run the the script using the 'PowerShell-Backup - Portable Version' shortcut, navigate to the settings menu, and choose the `2 - Install script to:` option).
37+
38+
A desktop shortcut and a Start Menu shortcut will be created. Run either of those to use the script. The install location is `C:\Users\%USERNAME%\Scripts\PowerShell-Backup`.
39+
40+
#
41+
42+
To uninstall this script and its files, delete the two folders `C:\Users\%USERNAME%\Scripts\PowerShell-Backup` and `%APPDATA%\Microsoft\Windows\Start Menu\Programs\PowerShell-Backup` and the desktop shortcut.
43+
2444
# USAGE
2545

46+
Run either the desktop shortcut or the Start Menu shortcut. Use option 1 of the main menu to backup a single folder. Use option 2 and the `Backuplist.txt` file to backup multiple folders at once in a batch job.
47+
48+
Upon being ran for the first time, the script will generate the `BackupList.txt` file in the `\config` folder. To use option `2 - Backup from list` of the main menu, list folder paths under their respective stanzas in the `BackupList.txt` file, save it, and then run option 2 of the script.
49+
2650
# CHANGE LOG
2751

52+
2.0.0 August 13th, 2018
53+
Re-wrote the script in the likeness of PowerShell-Youtube-dl. Cleaned up code.
54+
Can backup individual folders or use the BackupList.txt file to run batch jobs.
55+
Implemented some logging to the temp folder.
56+
57+
1.1.1 June 23rd, 2017
58+
Uploaded to Github.
59+
Condensed installer to one PowerShell script.
60+
Edited documentation.
61+
62+
1.1.0 June 12th, 2017
63+
Added ability to back up folders listed in backuplist.txt.
64+
2865
# ADDITIONAL NOTES
2966

30-
This script uses the 7-Zip program to compress folders for backing up. 7-Zip is licensed under the GNU LGPL license and its source code can be found at http://www.7-zip.org/.
67+
**NOTE:** This script utilizes 7-zip command line version 9.20 executable file. This version of 7-zip has been identified as being vulnerable to multiple code execution exploits via crafted archive files. Since the executable is only used to create archives, the danger these vulnerabilities pose are negligable as long as the 7-zip executable is only used by the script to create archives. This version of 7-zip is only used because of its ability to be easily downloaded and installed. To easily mitigate the vulnerabilities found in version 9.20, simply download 7-zip version 18.05 or higher and copy the file `7z.exe` to the `\bin` directory.
68+
69+
This script uses the 7-Zip program to compress folders for backing up. 7-Zip is licensed under the GNU LGPL license and its source code can be found at https://www.7-zip.org/.
3170

3271
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

backup.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
.NOTES
4141
Requires PowerShell version 5.0 or greater.
4242
Author: mpb10
43-
Updated: May 16th, 2018
43+
Updated: August 13th, 2018
4444
Version: 2.0.0
4545
.LINK
4646
https://github.com/mpb10/PowerShell-Backup
@@ -99,7 +99,7 @@ $BackupFromFileStatus = $True
9999

100100
# Function for simulating the 'pause' command of the Windows command line.
101101
Function PauseScript {
102-
If ($PSBoundParameters.Count -eq 0) {
102+
If ($CommandLine -eq $False) {
103103
Write-Host "`nPress any key to continue ...`n" -ForegroundColor "Gray"
104104
$Wait = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")
105105
}
@@ -152,7 +152,7 @@ Function ScriptInitialization {
152152

153153
$Script:BackupListFile = $ConfigFolder + "\BackupList.txt"
154154
If ((Test-Path "$BackupListFile") -eq $False) {
155-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/install/files/BackupList.txt" "$ConfigFolder\BackupList.txt"
155+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/install/files/BackupList.txt" "$ConfigFolder\BackupList.txt"
156156
}
157157
}
158158

@@ -179,11 +179,11 @@ Function InstallScript {
179179

180180
Copy-Item "$PSScriptRoot\backup.ps1" -Destination "$RootFolder"
181181

182-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/install/files/PowerShell-Backup.lnk" "$RootFolder\PowerShell-Backup.lnk"
182+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/install/files/PowerShell-Backup.lnk" "$RootFolder\PowerShell-Backup.lnk"
183183
Copy-Item "$RootFolder\PowerShell-Backup.lnk" -Destination "$DesktopFolder\PowerShell-Backup.lnk"
184184
Copy-Item "$RootFolder\PowerShell-Backup.lnk" -Destination "$StartFolder\PowerShell-Backup.lnk"
185-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/LICENSE" "$RootFolder\LICENSE.txt"
186-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/README.md" "$RootFolder\README.md"
185+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/LICENSE" "$RootFolder\LICENSE.txt"
186+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/README.md" "$RootFolder\README.md"
187187

188188
Write-Host "`nInstallation complete. Please restart the script." -ForegroundColor "Yellow"
189189
PauseScript
@@ -195,7 +195,7 @@ Function InstallScript {
195195

196196

197197
Function UpdateScript {
198-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/install/files/version-file" "$TempFolder\version-file.txt"
198+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/install/files/version-file" "$TempFolder\version-file.txt"
199199
[Version]$NewestVersion = Get-Content "$TempFolder\version-file.txt" | Select -Index 0
200200
Remove-Item -Path "$TempFolder\version-file.txt"
201201

@@ -204,21 +204,21 @@ Function UpdateScript {
204204
$MenuOption = Read-Host "`nUpdate to this version? [y/n]"
205205

206206
If ($MenuOption.Trim() -like "y" -or $MenuOption.Trim() -like "yes") {
207-
DownloadFile "http://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/backup.ps1" "$RootFolder\backup.ps1"
207+
DownloadFile "http://github.com/mpb10/PowerShell-Backup/raw/master/backup.ps1" "$RootFolder\backup.ps1"
208208

209209
If ($PSScriptRoot -eq "$InstallLocation") {
210210
If ((Test-Path "$StartFolder") -eq $False) {
211211
New-Item -Type Directory -Path "$StartFolder" | Out-Null
212212
}
213213

214-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/install/files/Youtube-dl.lnk" "$RootFolder\PowerShell-Backup.lnk"
214+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/install/files/Youtube-dl.lnk" "$RootFolder\PowerShell-Backup.lnk"
215215
Copy-Item "$RootFolder\PowerShell-Backup.lnk" -Destination "$DesktopFolder\PowerShell-Backup.lnk"
216216
Copy-Item "$RootFolder\PowerShell-Backup.lnk" -Destination "$StartFolder\PowerShell-Backup.lnk"
217-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/LICENSE" "$RootFolder\LICENSE.txt"
218-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/README.md" "$RootFolder\README.md"
217+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/LICENSE" "$RootFolder\LICENSE.txt"
218+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/README.md" "$RootFolder\README.md"
219219
}
220220

221-
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/version-2.0.0/install/files/UpdateNotes.txt" "$TempFolder\UpdateNotes.txt"
221+
DownloadFile "https://github.com/mpb10/PowerShell-Backup/raw/master/install/files/UpdateNotes.txt" "$TempFolder\UpdateNotes.txt"
222222
Get-Content "$TempFolder\UpdateNotes.txt"
223223
Remove-Item "$TempFolder\UpdateNotes.txt"
224224

@@ -531,7 +531,7 @@ If ($CheckForUpdates -eq $True -and $Install -eq $False) {
531531

532532
If ((Test-Path "$TempFolder\powershell-backup_log.log") -eq $True) {
533533
If ((Get-ChildItem "$TempFolder\powershell-backup_log.log").Length -gt 25000000) {
534-
Remove-Item -Path "$TempFolder\powershell-backup_log.log"
534+
Get-Content "$TempFolder\powershell-backup_log.log" | Select-Object -Skip 50000 | Out-File "$TempFolder\powershell-backup_log.log"
535535
}
536536
}
537537

@@ -541,14 +541,14 @@ If ((Test-Path "$BinFolder\7za.exe") -eq $False -and $Install -eq $False) {
541541
}
542542

543543
If (($PSBoundParameters.Count) -gt 0) {
544+
$CommandLine = $True
544545
CommandLineMode
545546
}
546547
Else {
548+
$CommandLine = $False
547549
MainMenu
548550
}
549551

550-
Write-Host "End of Script"
551-
PauseScript
552552
Exit
553553

554554

install/files/UpdateNotes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
1. Re-wrote the script in the likeness of PowerShell-Youtube-dl. Cleaned up code.
77

88
2. Can backup individual folders or use the BackupList.txt file to run batch jobs.
9+
10+
3. Implemented some logging to the temp folder.
911

1012
===================================================================================================

0 commit comments

Comments
 (0)