SolarWinds | Serv-U
Contact Support: 866-530-8040 | Contact Sales: 855-498-4154 or email | Show Flags | Login
Serv-U FTP Server Home Page
The Best for Less
Secure file transfer & share files
from anywhere - affordably

BUY NOW
FREE for 14 Days
Full featured trial with secure
FTP, file sharing & web transfer

DOWNLOAD FREE TRIAL


Moving Files After They Are Uploaded to Serv-U  -  KB Article #2165

Related Articles -- 2160

Issue:

I want to move a file somewhere else after it is uploaded to Serv-U.

Solution:

To move a file to a different location, you can create a File Moved event at the server, domain, group, and user level.
Perform the following steps to create this event.

  1. If you want to create a File Moved event on the server or domain level, navigate to Server/Domain Details > Events in the Management Console. If you want to create this event on the group or user level, select the appropriate user or group under Users/Groups, click Edit, and then click Events.
  2. Click Add.
  3. Select File Uploaded from the Event Type list.
  4. Provide an event name and an optional description.
  5. Under Event Actions, select Execute Command from the Action list.
  6. In Executable Path, browse to the file that contains the command you want to execute.
  7. Specify the following Command Line Parameters. Make sure that you include the quotation marks to handle potential spaces in the path names.
    • "$LocalPathName"
    • "DestinationPath", which is the location where you want to move the file
  8. Specify the number of seconds to wait after starting the executable path in the Completion Wait Time field.
    Note: Configuring a value for Completion Wait Time will block Serv-U while it waits.
  9. Click Save.

The following examples provide sample commands you can adapt to your needs.

For Windows:

REM This moves a file from one location to another.
REM Arguments:
REM %1 - the full source path of the original file
REM %2 - the path to move the file to. This may be a directory if the
REM original filename is to be preserved, but it may also contain a new filename to use.
move %1 %2

For Linux:

#!/bin/sh
# This moves a file from one location to another.
# Arguments:
# $1 - the full source path of the original file
# $2 - the path to move the file to. This may be a directory if the original
# filename is to be preserved, but it may also contain a new filename to use.
mv $1 $2

Notes:

  • On Linux, you have to make sure that your script has execute permissions on it.
  • If you run Serv-U before version 15.1.0 on Linux, make sure that your command line parameters are passed to the script correctly. For more information, please refer to the KB article about Passing command line parameters to external applications.


Login to Customer Service Center

Please enter your e-mail address and password in the fields below.

Email Address:

Password: