Skip to main content

Pre / Post commands not possible

Thread needs solution
Hello.
On the AMS (Windows-Server) is a batch file under "C:\Batch\delete.cmd".
However, this is not executed.
As an agent I have chosen the AMS myself.
Why is my batch file not running? As test there is only

echo hallo
exit
0 Users found this helpful
frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Posts: 250
Comments: 7092

Hi,

You should also specify the Working directory (Arbeitsverzeichnis)

  1. In the Working directory field, specify a path to a directory where the command/batch file will be executed. This is a directory context of the command. This is not the folder with the batch file. This is equivalent to issuing command "cd FOLDERNAME" before running actual script.

For more information please refer to Acronis Software: Troubleshooting Pre/Post Commands Issues.

frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Posts: 250
Comments: 7092

Some examples from another discussion. 

Can i do this?

@echo off & setlocal

set "SrcDir=D:"
set "Exclude=".meta" "x""

del /q "%SrcDir%\*.*" 2>NUL

set "DoNotDelete="

for /f "delims=" %%d in ('dir /b /a:d "%SrcDir%"') do (
  for %%e in (%Exclude%) do (
    if "%%d" equ "%%~e" set "DoNotDelete=1"
  )

  if not defined DoNotDelete rd /s /q "%SrcDir%\%%d"
  set "DoNotDelete="
)

The script now works. Great!! I want to delete the removable disks before every backup. Unfortunately this is necessary, since always at least one backup remains on the disks. We change the hard disks every day. Is the procedure so ok?

frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Posts: 250
Comments: 7092

Glad to hear that :) If you want only one backup to be stored on each drive, then you may want using the script listed in Backing Up to Removable Devices with Regular Drive Swaps

Great. I have another question. All backup files are always _.tibx. Its the normal? The file name of the backup should be: [MachineName]-backup

frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Posts: 250
Comments: 7092

Hi,

Sorry for delayed response! I believe you've selected a managed location for backups. The above naming is expected for a managed location. Backup archives in an unmanaged location will be named like in the examples of Backup file name.