Quantcast
Channel: Backup – Windows and Windows Server forum
Viewing all articles
Browse latest Browse all 3323

How do I answer Y to WBADMIN prompts in a bat file this is running unattended via the task scheduler?

$
0
0

I want to automate the cleanup of backup versions. I am just backing up a folder to test with. 

Wbadmin start backup  -backuptarget:\\testsrvr\BackupTest\bkup02 -include:E:\temp -quiet

I can script the delete of the remote shared folders, but I also want to delete the catalog entry that references them. The -quiet just suppresses the prompts.  There is no -force option. I have tried "echo y|" but there are 2 prompts. I don't want to run this command manually. 

I know that I can delete the entire catalog with "wbadmin delete catalog -quiet", but I want to keep the current entries. Or doesn't it matter and I should just delete the entire catalog?

And as a side question, why can't wbadmin delete the backups in the remote shared folder? I've manually deleted the folders before I run the delete backup command and wbadmin still says that it can't delete the backups. 

C:\>WBADMIN DELETE BACKUP -keepVersions:1 -quiet
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2013 Microsoft Corporation. All rights reserved.

Enumerating backups...
Found 2 backups,
1 will be left after the delete operation.
Deleting backup version 03/09/2016-19:02 (1 out of 1)...
The operation to delete backup version 03/09/2016-19:02
failed with error: Backups in the remote shared folder cannot be deleted. To reclaim the space,.....
.
The operation to delete backups completed,
0 backups were deleted.

C:\>WBADMIN DELETE BACKUP -keepVersions:1
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2013 Microsoft Corporation. All rights reserved.

Enumerating backups...
Found 2 backups,
1 will be left after the delete operation.
Do you want to delete the backups?
[Y] Yes [N] No y

Deleting backup version 03/09/2016-19:02 (1 out of 1)...
The operation to delete backup version 03/09/2016-19:02
failed with error: Backups in the remote shared folder cannot be deleted. To reclaim the space,.....
.
The backup cannot be deleted because the backup storage location is not
available. Do you want to delete the entry of the backup in the catalog?
(This option will not free space on the storage location.)
[Y] Yes [E] Yes for all similar errors [N] No [O] No for all similar errors y

The operation to delete backups completed,
1 backups were deleted.


Viewing all articles
Browse latest Browse all 3323

Latest Images

Trending Articles





Latest Images