At line 3 added 17 lines |
[CrushTask Functions] helps explain some of the advanced string manipulation functions you can do in CrushTask, typically in a UserVariable task. |
|
[Example Task Flow -- Folder monitor triggered task.|CrushTaskExample]\\ |
[Example Task Flow -- Find local files and copy them to remote servers.|CrushTaskExample2]\\ |
[Example Task Flow -- Expire users password and email password reset link.|CrushTaskExample3]\\ |
[Example Task Flow -- Import users from *.csv file.|CrushTaskExample4]\\ |
[Example Task Flow -- Allow username lookup on internal share.|CrushTaskExample5]\\ |
[Example Task Flow -- Delete subfolders but keep root folders.|CrushTaskExample6]\\ |
[Example Task Flow -- Self register and enable accounts.|CrushTaskExample7]\\ |
[Example Task Flow -- Notify users of expired password.|CrushTaskExample8]\\ |
[Example Task Flow -- Auto register and set password on first logon.|CrushTaskExample9]\\ |
[Example Task Flow -- Auto Update CrushFTP.|CrushTaskExample10]\\ |
[Example Task Flow -- Upload with approval and move files.|CrushTaskExample11]\\ |
[Example Task Flow -- Looping though files and delete copied files.|CrushTaskExample12]\\ |
[Example Task Flow -- Find new files and send a notification or process them.|CrushTaskExample13]\\ |
|
|
At line 23 added 2 lines |
|
The error jump field allows you to jump to a particular task item in the list if the current task fails for any reason. |
At line 8 changed one line |
The find task will scan a particular folder, or remote FTP, or SFTP server getting directory listings recursively up to the depth allowed. These found items can then be used by future task items. |
The find task will scan a particular folder, or remote FTP, or SFTP server getting directory listings recursively up to the depth allowed. These found items can then be used by future task items. This task is often the starting item in a list of tasks. |
At line 29 added 8 lines |
You can enable verification that the files are not changing to prevent getting files that are still being written to. If you want to preserve the folder path to the files for a future copy, enable the "Use absolute paths" option. |
|
The last modified selection will only find files that are the specified age, either newer or older. |
|
If no items have been found, it can continue scanning for up to the maximum minutes defined, with a pause of the defined number of seconds between scans. If at the end of all of this, no files are found, you can cause the task to fail with the "Fail if no files are found" checkbox. |
|
If the FindCache option is used, the items found will further be filters out so prior known items aren't found again. |
|
At line 39 added 9 lines |
!FindCache |
This cache task allows you to load in a prior listing of items to be compared with a new listing. This allows you to filter out prior known items that have already been processed without ever altering them on the remote server. |
|
You first do a "read" mode on the FindCache, specifying the name. Then in the copy task, you specify that same name. If the Find task item finds an item already in the list, then its ignored. |
|
Next you would do another FindCache and do a "write" mode so it saves the list back to disk with the updated listing. Any items the FindCache knew about that are no longer on the server are removed from the list that is saved as well. |
|
[attachments|findcache_task.png] |
---- |
At line 72 added 9 lines |
The body can also generate temporary share links. Examples:\\ |
http://domain.com/{share_move_30}\\ |
http://domain.com/{share_move_15}\\ |
http://domain.com/{share_reference_45}\\ |
http://domain.com/{share_copy_7}\\ |
http://domain.com/{share_copy_22}\\ |
|
Where the middle part is the share type, and the ending part is the number of days. |
|
At line 39 changed one line |
This task allows for running an external process. This can allow outside integration processes to be performed. The output of these programs are fed into the log for this task to allow for monitoring of its results. keep in mind in windows, running a bat file requires running cme.exe, and passing int he arguments for cmd.exe to execute the batch file. |
This task allows for running an external process. This can allow outside integration processes to be performed. The output of these programs are fed into the log for this task to allow for monitoring of its results. |
At line 42 changed one line |
--- |
|
!input: |
*Command: the name of (or full path to) the external binary. In case running scripts, here comes the script interpreter binary name, cmd.exe for a Windows batch script\\ |
or sh , /bin/bash , etc. for a linux shell script, etc.\\ |
*Argument: the list of arguments passed to Command, the list items separated by Separator character ";" (semicolon) by default. In case running scripts, here comes\\ |
the script file name followed by any arguments to be passed to |
*Working directory: the parent path of the binary or script file, we do a change directory into this folder before invoking Command. In case running scripts, here comes\\ |
the full parent path of the script file |
*Environment variables: leave it empty, rarely needed |
!output: |
the task will feed it's output to the next task item, if any, can be referenced by the {execute_log} server variable |
---- |
At line 109 added 129 lines |
!Preview |
This task will instantly pass in any found files to the [preview] worker inside of CrushFTP requesting for the files to have their thumbnails generates. This is only useful if you are showing previews of image type files on the [WebInterface]. |
|
[attachments|preview_task.png] |
---- |
!Rename |
This task will rename a file in its current location to have a new name. |
|
[attachments|rename_task.png] |
---- |
!Jump |
This task will jump to a specified job, and task item. If the job is left empty, then the task in the current job will be located and used. If a job is jumped to, the task that matches the name will be the starting point in that job. Jumping to a job is only possible for enterprise licenses. Once the jumped to job is complete, the task will continue on to the next step of the current job. |
|
[attachments|jump_task.png] |
---- |
!UserVariable |
This allows you to make a variable that you will then reference in other future steps. So you might make a "archive" variable, and then reference it in other steps as {archive} so that fi that changed, you would only need to change it in one location. |
|
[attachments|uservariable_task.png] |
---- |
!UnZip |
This will unzip a file that is in the list. Its suggested you filter down on *.zip to only get valid items in case of a mixed list of items. The external unzip method will call the OS's unzip utility to unzip. This will only work on OS X, or Linux / Unix based systems. Otherwise the internal method will work too. |
|
[attachments|unzip_task.png] |
---- |
!Zip |
This will take all items in the list and zip them into a single file. Its suggested to then do an Exclude task to them remove all items, and then go Find the single zip you just made if you want to do further processing. |
|
[attachments|zip_task.png] |
---- |
!Wait |
This task will pause for the requested number of seconds before going to the next step. You can also enable the wait for previous threads, and it will wait indefinitely until the prior MultiThreaded tasks have all completed. |
|
[attachments|wait_task.png] |
---- |
!WriteFile |
This task will write to a log file, or xml file, or whatever you like, information about the files being processed. One example is to create an RSS feed of incoming files. The RSS configuration is pre-filled in the fields by default. You can have the task find a specific piece of text starting from the beginning of the file, and then insert the new data there, or find a specific piece of text going from the end of the file, and then append data there. If the file doesn't exist yet, the New File section will be written to the file before it performs the searches and updates to the file. |
|
[attachments|writefile_task.png] |
---- |
!AS2 |
This task allows for taking the items in the list and sending them on to a AS2 server. You can configure all the typical AS2 settings for encryption and signing. |
|
[attachments|as2_task.png] |
---- |
!HTTP |
The HTTP task lets you post events to another HTTP server with information about files that were transferred. You can control various aspects about how the connection is made and put in your variables for the data you want posted. |
|
[attachments|http_task.png] |
---- |
!PGP |
Files can be encrypted, or decrypted using PGP public/private keys. |
|
[attachments|pgp_task.png] |
---- |
!POP3 / IMAP |
This task allows you to scan a mail server finding matching emails based on subjects or senders, and pull out attachments from them. You can optionally delete the messages after your done too. These attachments can then be processed with CrushTask in additional methods. This task type is only allowed for Enterprise licenses. |
|
[attachments|popimap_task.png] |
|
Here is a list of other possible variables: |
subject, body, from, mail_index, mail_type, url, the_file_name, the_file_path, modified, from_prefix. |
|
---- |
!Users List |
This task can iterate through your users, and make calls to another task item for each user in the list. A good use for this might be the popimap task if you wanted to monitor the user's email server and give them files that had arrived for example. |
|
[attachments|userslist_task.png] |
---- |
!Java |
Here is a sample class that needs to be in the class path. You then reference it directly in the job. You need to include the library for CrushTask.jar for this. Then in your java class, reference "task.MyClass" |
|
{{{ |
package tasks; |
|
import java.util.Properties; |
import java.util.Vector; |
|
public class MyClass extends Task |
{ |
|
public MyClass(Properties prefs, Vector items, Properties info, Vector threads) |
{ |
super(prefs, items, info, threads); |
} |
|
public Task go() |
{ |
run(); |
return null; |
} |
|
public void run() |
{ |
try |
{ |
newItems.addAll(items);//keep all the items for the next task. |
for (int x = 0; x < items.size(); x++) |
{ |
Properties p = (Properties) items.elementAt(x); |
System.out.println(p.getProperty("url")); |
} |
Vector v = (Vector) prefs.get("prop_item"); |
Properties prop_item = new Properties(); |
for (int x = 0; x < v.size(); x++) |
{ |
Properties p = (Properties) v.elementAt(x); |
prop_item.put(p.getProperty("key"), p.getProperty("val", "")); |
} |
Enumeration keys = prop_item.keys(); |
while (keys.hasMoreElements()) |
{ |
String key = keys.nextElement().toString(); |
String val = prop_item.getProperty(key, "").trim(); |
} |
msg("MyClass"); |
} |
catch (Exception e) |
{ |
e.printStackTrace(); |
msg(e); |
error = e; |
} |
} |
} |
}}} |
---- |
!Custom |
This is a placeholder for custom tasks developers make in the future. |