Daily Automatic Backup Using Powershell Script

Mention in Task Scheduler powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Administrator\Desktop\FFScript.ps1" ----------------------------------------- Copy Below Script ----------------------------------------- ===== CONFIGURATION ===== Source (Main Server) $source = "\\192.168.10.12\c$\Users\Administrator\Desktop\Dahua & Hikvision Camera Config Tool" Base Destination (VM Machine) $baseDestination = "D:\Data Backup\May-2026\Dahua & Hikvision Camera Config Tool" Log folder $logFolder = "D:\Data Backup\log" Target Date $date = Get-Date ===== DATE RANGE ===== $startDate = $date.Date $endDate = $startDate.AddDays(1) ===== CREATE DATE FOLDER ===== $dateFolder = $date.ToString("dd-MM-yyyy dddd") $destination = Join-Path $baseDestination $dateFolder ===== CREATE DESTINATION FOLDER IF NOT EXISTS ===== if (!(Test-Path $destination)) { New-Item -ItemType Directory -Path $destination | Out-Null } ===== CREATE LOG FOLDER IF NOT EXISTS ===== if (!(Test-Path $logFolder)) { New-Item -ItemType Directory -Path $logFolder | Out-Null } ===== LOG FILE ===== $logFile = Join-Path $logFolder ("backup_" + $dateFolder + ".log") ===== START LOG ===== "===== Backup Started: $(Get-Date) =====" | Out-File $logFile -Append ===== GET FILES AND FOLDERS ===== Get-ChildItem -Path $source -Recurse | Where-Object { $_.LastWriteTime -ge $startDate -and $_.LastWriteTime -lt $endDate } | ForEach-Object { try { Create relative path $relativePath = $_.FullName.Substring($source.Length).TrimStart("\") Destination path $targetPath = Join-Path $destination $relativePath If item is a folder if ($_.PSIsContainer) { if (!(Test-Path $targetPath)) { New-Item -ItemType Directory -Path $targetPath -Force | Out-Null } "FOLDER SUCCESS: $($_.FullName)" | Out-File $logFile -Append } else { Create parent folder if not exists $parentFolder = Split-Path $targetPath -Parent if (!(Test-Path $parentFolder)) { New-Item -ItemType Directory -Path $parentFolder -Force | Out-Null } Copy file Copy-Item $_.FullName -Destination $targetPath -Force "FILE SUCCESS: $($_.FullName)" | Out-File $logFile -Append } } catch { "ERROR: $($_.FullName) - $_" | Out-File $logFile -Append } } ===== END LOG ===== "===== Backup Completed: $(Get-Date) =====" | Out-File $logFile -Append Write-Host "Files and folders copied to $destination. Log saved at $logFile"

Uruguay – Spanien Highlights | Gruppe H, FIFA WM 2026 | sportstudio
▶︎

Uruguay – Spanien Highlights | Gruppe H, FIFA WM 2026 | sportstudio

تلاوة القرآن للدراسة والتركيز 📚🕛 | راحة وطمأنينة | Peaceful Focus Quran | محمد هشام
▶︎

تلاوة القرآن للدراسة والتركيز 📚🕛 | راحة وطمأنينة | Peaceful Focus Quran | محمد هشام

FREE Malware Removal Tools That Actually Work!
▶︎

FREE Malware Removal Tools That Actually Work!

ASMR Addictive Fast Tapping Collection For Deep Sleep & Anxiety Relief (No Talking) — 2.5 Hours
▶︎

ASMR Addictive Fast Tapping Collection For Deep Sleep & Anxiety Relief (No Talking) — 2.5 Hours

20% of Linux Commands You'll Use 80% of the Time (Real-World Example)
▶︎

20% of Linux Commands You'll Use 80% of the Time (Real-World Example)

Total Idiots at Work Caught on Camera | Best of 2024
▶︎

Total Idiots at Work Caught on Camera | Best of 2024

248 DIOS TE DICE HOY: NADA ES IMPOSIBLE PARA MÍ | CONFÍA EN DIOS
▶︎

248 DIOS TE DICE HOY: NADA ES IMPOSIBLE PARA MÍ | CONFÍA EN DIOS

Using Large Language Models | Build Your Own LLM Workshop #1
▶︎

Using Large Language Models | Build Your Own LLM Workshop #1

Linux 7.2 Review: MAJOR Performance, GPU, CPU, and Networking Upgrades
▶︎

Linux 7.2 Review: MAJOR Performance, GPU, CPU, and Networking Upgrades

Revealing The SPECIAL TECHNIQUE Of A Pakistani Man To EXTRACT GOLD From Used Motherboard Waste
▶︎

Revealing The SPECIAL TECHNIQUE Of A Pakistani Man To EXTRACT GOLD From Used Motherboard Waste

How To Change RDP Port Using PowerShell Script
▶︎

How To Change RDP Port Using PowerShell Script

Crash Course, Active Directory, DHCP & DNS for Entry Level Tech Support
▶︎

Crash Course, Active Directory, DHCP & DNS for Entry Level Tech Support

Framed Art Screensaver Spring | TV Art Slideshow Modern | Floral Frame Background
▶︎

Framed Art Screensaver Spring | TV Art Slideshow Modern | Floral Frame Background

Only Pakistani Mechanics Can Repair This Giant Caterpillar Loader Tire
▶︎

Only Pakistani Mechanics Can Repair This Giant Caterpillar Loader Tire

National and International Free Calls Using Zerotier in Issabel-5 | Lecture-16
▶︎

National and International Free Calls Using Zerotier in Issabel-5 | Lecture-16

Türkei – USA Highlights | Gruppe D, FIFA WM 2026 | sportstudio
▶︎

Türkei – USA Highlights | Gruppe D, FIFA WM 2026 | sportstudio

But what is quantum computing?  (Grover's Algorithm)
▶︎

But what is quantum computing? (Grover's Algorithm)

5 CLI Tools That Actually Changed How I Work in 2026
▶︎

5 CLI Tools That Actually Changed How I Work in 2026

Aesthetic Aura Background 3 hours
▶︎

Aesthetic Aura Background 3 hours

40Hz Binaural Gamma Waves - Ultra Deep Concentration
▶︎

40Hz Binaural Gamma Waves - Ultra Deep Concentration