Table of contents
It is possible to use the hosting of attachments in the cloud so they are available at all times. Backups are already in place in the cloud, but some customers who have important processes in Octopus prefer to have a local copy of the attachments in case their external network fails or if Octopus is not available.
AttachmentDownloader allows you to download all Octopus attachments from the cloud to the local network.
How It Works
The AttachmentDownloader program allows you to download all the hosted attachments of a team manually or automatically using a Windows scheduled task.
The program runs for one team at a time and downloads the files to the attachment folder configured for that team.
- Have attachments hosted by Octopus.
Create an Octopus system account that will be used to run the task. See Octopus System Account information.
- Creating a folder to download the attachments on the local network.
- If the DB contains more than one team, a different folder is recommended for each team.
- The full folder path must be added to the configuration of each team that uses AttachmentDownloader from Tools > Options > 3- Important general options > Network directory containing the attached files.
- The rights for Octopus users of each team must be allocated based on the use to be made.
How to Use AttachmentDownloader
AttachmentDownloader is a program that runs from a command line (DOS). It is designed to be easy to automate.
To run the ESI.Octopus.DataImporterApp.exe program, you must open a Dos prompt and position yourself in the Octopus folder. Subsequently, enter the command line. (See Command Line Examples).
By default the Octopus folder is located in C:\Program Files\Octopus OR \%homepath%\AppData\Local\Octopus.
Examples of folders where Octopus can be located:
- For Windows 7 and +
- For Windows XP
- C:\Documents and Settings\slevesque\Local Settings\Application Data\Octopus.
There are many available parameters, of which 3 are mandatory, to execute AttachmentDownloader:
- Octopus Username.
- Octopus Password.
- The number of the team's attachments to download.
- By default, IT is team number 1.
- How to find the team number?
Example: ESI.Octopus.AttachmentDownloaderApp.exe /Login:system /Password:octo /Team:1
- Although this parameter is not mandatory, logically it should always be used to ensure that the local copy of the attachment is up-to-date.
- Overwrites the old copy of an attachment with the cloud version.
- Without this setting, AttachmentDownloader will simply add the new attachments without updating the ones that have already been uploaded.
- To replace the location of the log file. By default, the file is named AttachmentDownloaderApp_AAAAMMJJ_HHMMSS.log and will be located in the Octopus folder.
- If you move the file to another folder, make sure this folder exists (the system cannot create the folder).
- Furthermore the path must contain the name of the file.
- To learn more about the location of Octopus files, see the Octopus Installation Folder article.
Example : /LogFilePath:C:\LogFiles\AttachmentDownloaderJournal.log
- Allows to force the activation of a key press after the import is executed. Meaning the DOS window will be shown until a key is pressed.
This option is useful when doing tests to make sure there are no problems with the command line.
Note that this parameter should not be used in a recurring task.
- Can automatically erase old log files
- The parameter is used to determine how many days of log files that you want to keep.
- For more information, see the Octopus Tools | Maintenance of log files.
- Command line for downloading attachments with basic parameters.
ESI.Octopus.AttachmentDownloaderApp.exe /Login:system /Password:octo /Team:1 /ForceReplaceFiles
- Command line for downloading attachments with optional parameters.
ESI.Octopus.AttachmentDownloaderApp.exe /Login:system /Password:octo /Team:1 /ForceReplaceFiles /WaitKeyPress /LogFilePath:G:\ABCFolder
Refer to the Windows Scheduled Task article to find out how to automate downloads with AttachmentDownloader.
Operation Log File
During execution, AttachmentDownloader creates a log file in addition to the results returned on screen. This log is saved in the AttachmentDownloaderApp_AAAAMMJJ_HHMMSS.log file and it is located in the Octopus folder from where AttachmentDownloader is run.
Thank you, your message has been sent.