Backing up the database using C #, the bak file is getting bigger and bigger, how can I stop it from growing?

So the scenario is that, apparently, it adds a bak to the file when it is created, is it possible to stop it from doing this and just back up the current version?

here is my code

Server backFromServer = new Server(@"server ip add");
backFromServer.ConnectionContext.LoginSecure = false;
backFromServer.ConnectionContext.Login = "uname";
backFromServer.ConnectionContext.Password = "psd";
Database backFromDb = new Database();
backFromDb = backFromServer.Databases["dbname"];

Backup bkpDatabase = new Backup();
bkpDatabase.Action = BackupActionType.Database;
bkpDatabase.Database = backFromDb.Name;
bkpDatabase.Incremental = false;
bkpDatabase.LogTruncation = BackupTruncateLogType.Truncate;                

BackupDeviceItem bkpDevice = new BackupDeviceItem(@"D:\backupfolder\backup.bak",
                                                  DeviceType.File);

bkpDatabase.Devices.Add(bkpDevice);
bkpDatabase.SqlBackup(backFromServer);
+3
source share
1 answer

Set Backup.Initialize to true:

"If True, the specified backup becomes the first set of backups on the media, overwriting any existing backup sets on the media."

+7
source

Source: https://habr.com/ru/post/1787560/