How to Automate FiveM Server Backups
In this tutorial, you will learn how to set up automated backups for your FiveM server using a PowerShell script and Windows Task Scheduler. Automating...

In this tutorial, you will learn how to set up automated backups for your FiveM server using a PowerShell script and Windows Task Scheduler. Automating your backups ensures your server data is safe and can be restored if needed.
Step 1: Download the Backup Script
- Download the backup script from the GitHub repository.
- Save the
ServerBackupScript.ps1file in a location accessible to your server.
Step 2: Set Up Backup Folders
- Create Backup Directory:
- Navigate to your server's root directory (where the FX Server starter is located).
- Create a new folder named
backup.
- Edit the PowerShell Script:
- Open the
ServerBackupScript.ps1in a text editor (e.g., Notepad). - Update the
$sourcePathto the folder you want to back up. For example:$sourcePath = "C:\MyServer\resources" - Update the
$destinationPathto the folder where backups should be stored. For example:$destinationPath = "C:\Backups\ServerBackup_$backupDate" - The
$backupDatevariable appends the current date and time to the backup folder name for better organization.
- Open the
Step 3: Set Up a Scheduled Task
- Open Task Scheduler:







