Powershell Backup Script for FiveM

Does use a script to automatically backup their FiveM folder, and move it to a separate drive/server/off site location?

I am looking to create a Powershell script to backup my FXServer folder, zip it, copy it to a separate server and then send an email when it is all done. I have a general backup script that does half of what I want to do, but doesn’t send an email.

Are you using linux?

Windows Server 2012 R2

This is the script I am currently using for backups:

function create-7zip([String] $aDirectory, [String] $aZipfile){
	[string]$pathToZipExe = "C:\Program Files\7-Zip\7z.exe";
	[Array]$arguments = "a", "-tzip", "$aZipfile", "$aDirectory", "-r";
	& $pathToZipExe $arguments;
}

$GetDate = Get-Date -Format MMddyyHHmmss
$GetFolder = ""
$GetBackupFolder = ""
$GetFileName = ""
$ServerName = ""


Create-7zip $GetFolder $GetBackupFolder$GetFileName

Echo "Backup to $ServerName has completed.  The file is called: $GetFileName"

Hid variables for privacy.