Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $insomnia = Start-Process -FilePath "C:\home\lumpy\Insomnia.exe" -PassThru
- $date = get-date -uformat '%Y-%m-%d'
- write-output $date
- $backupDir = "e:\$date"
- if (Test-Path -Path $backupDir) {
- write-output "$backupDir exists"
- }
- else {
- New-Item -Path $backupDir -ItemType Directory
- }
- $dirs = @( "c:\home\lumpy", "f:\audio", "f:\pics" )
- foreach ( $dir in $dirs ) {
- $destDir = Split-Path $dir -Leaf
- write-output "$dir -> $backupDir\$destDir"
- robocopy $dir $backupDir\$destDir /mir /mt:32 /log+:$backupDir\log+.txt
- }
- $files = @( "music.rar", "copyall-x.ps1", "copyall-z.ps1", "copyall-*" )
- foreach ( $file in $files ) {
- write-output "$file"
- Copy-Item -Path f:\$file -Destination $backupDir\$file -recurse -Force
- }
- Get-Date
- Stop-Process -InputObject $insomnia
Advertisement
Add Comment
Please, Sign In to add comment