0

I am using this code to backup databases. There is 7 of them. The backup name will follow as the database name then the timestamp. I do not want the timestamp. I am not sure how to get rid of it. I tried adding -ReplaceInName and nothing happened.

Backup-DbaDatabase -SqlInstance $SQLServer1 -Database $Database1 -Path $NewPath1 -Type Full -IgnoreFileChecks -ReplaceInName
movement
  • 33
  • 5
  • 1
    Have you consulted `Get-Help Backup-DbaDatabase` yet? Either 1) don't include the `timestamp` keyword inside `$NewPath1` or 2) use `-ReplaceInName:$false` (which is the default, by the way) but then it won't replace `instancename`, `servername` or `backuptype` either. – AlwaysLearning Mar 28 '23 at 00:00
  • You might want to use the `-FilePath` switch instead, not the `-Path` switch. `-Path` is to denote the directory to place the backup(s), where as `-FilePath` can be used to denote the *file's* path. So `C:\Backups\YourDatabase.Bak` vs `C:\Backups` respectively. – Thom A Mar 28 '23 at 08:43
  • I do not have the timestamp keyword in $newPath1 @AlwaysLearning – movement Mar 28 '23 at 14:28
  • Still no luck @ThomA – movement Mar 28 '23 at 14:30
  • Provide a full [mre] then, @movement . – Thom A Mar 28 '23 at 14:33

0 Answers0