Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore files within the 'Delete Files Task'

As part of my install scripts for Visual Studio Online (VSO / VSTS) I delete the files in my directory shortly after uninstalling the services.

We have configuration files and logs that I'd like to preserve but everytime I try to tell the 'Delete Files Task' to ignore those files it deletes them anyway.

What I want is for ALL files in the Bifrost directory to be deleted except for

  • The Logs folder
  • App.Connections.Config
  • App.Queues.Config

Can someone help please?

enter image description here

like image 292
Chris Avatar asked Jul 25 '17 12:07

Chris


People also ask

How do you delete a file which is not deleting?

One is simply using the delete option, and the other one is deleting files permanently. When you can't delete a file normally, you can delete undeletable files Windows 10 by selecting the target file or folder and then press Shift + Delete keys on the keyboard for a try.

How do I automatically delete files?

Setting a folder to auto-deletebutton for the folder and select Settings. From the Folder Settings screen scroll down to Automated Actions>Delete or Unshare.


1 Answers

  • If the files you want to delete are located in the agent folder or the subfolder of the agent machine, you can use Delete Files Task. Because the Source Folder of Delete Files Task can only be specified for the agent machine.
  • If the files you want to delete are located on another remote machine, you should use Powershell task or RemoteDelete task to delete the files.

    For powershell task, there are many powershell script on the web to delete files from remote machine.

    For RemoteDelete task, you can set as below:

    Input your remote machine’s IP, username and password.

    Path: the directory for Bifrost folder, such as D:\test\Bitfrost

    Include Items: folders and files you want to delete and separate with comma (,). Such as delete folder temp and file *.txt, you can specify with temp,*.txt

    Exculde Items: folders and files you want to keep. For you situation, you should specify as Logs,App.Connections.Config,App.Queues.Config

    Note: the Include Items option can't leave empty or use **, otherwise it will delete all the files and folders in Bifrost.

like image 156
Marina Liu Avatar answered Oct 17 '22 23:10

Marina Liu