Knowledge Base

Home > How To > How To timestamp downloads

Created
Modified

Print Article

Article 2608

How To timestamp downloads

Sometimes it is necessary to dynamically change the destination file/folder name. For example if you have a backup task scheduled which should put the files into a different folder each time it is started. 

Tutorial

Part 1 - AddToQueue.exe Tool

In this part we are getting familiar with the AddToQueue.exe command line tool.

  1. Download and install the SmartFTP SDK
  2. Open a command prompt: cmd.exe
  3. Go to the %ProgramFiles%\SmartFTP Client folder:
    cd "%ProgramFiles%\SmartFTP Client"
  4. Run AddToQueue.exe
    The syntax of the tool will be displayed
  5. The syntax to upload a local folder would look something like that:
    AddToQueue.exe copy folder c:\temp\backup {AEB81A25-62AB-4FB6-B25B-2C2A3F58ECE4}/temp/backup
    where {AEB81A25-62AB-4FB6-B25B-2C2A3F58ECE4} is the FavoriteId
  6. Now we need to figure out the FavoriteId

Part 2 - FavoriteId

In this part we will figure out the unique FavoriteId for a particular favorite in SmartFTP.

  1. Start SmartFTP
  2. Go to the menu: Tools - Edit Favorites
  3. The Favorites window opens
  4. Right-click on the column header on the right side
  5. Select More... from the context menu
  6. Check Favorite Id in the Details list
  7. Click OK to save the changes
  8. Now the Favorite Id for each favorite will be displayed in the view.

Part 3 - Create Batch File

Now since we have all the information to use the AddToQueue.exe tool, we can build our batch file which dynamically sets the destination name.

  1. Start with the Backup.cmd from the %ProgramFiles(x86)\%SmartFTP Client SDK\Samples\TransferQueue\AddToQueue folder
  2. Update the values in the Backup.cmd:
    SourceFolder
    FavoriteId
    RemoteDestination
  3. Run the Backup.cmd and verify that the correct item is added to the SmartFTP Transfer Queue.
    Tip: It may be a good idea to temporary stop the transfer queue

Part 4 - Create scheduled task (optional)

In this part we are going to create a scheduled task in the Windows Task Scheduler which runs the Backup.cmd we have created in Part 3. If you already automate your process with a batch file, this is not required.

  1. Go to Control Panel - Administrative Tools
  2. Task Scheduler
  3. Create new task and run the backup.cmd at the times you desire

Keywords
timestamp

Related Articles


What do you think about this topic? Send feedback!