|
Copy to New Job Version :
Encryption
Be especially careful when using delete task as you could delete the original and copy.
%user_name%, {real_path}, {path}, {name}, {size}, {speed}, {error}
Example: If the command was "cp" and the argument was "{real_path}:/archive/{name}"
Then, if a file was uploaded to "/uploads/stuff.zip", it would be copied to "/archive/stuff.zip"
Note the purpose of the ":" in that, it separates argumets to the command.
If an item matches the filter, it will be excluded from the future task processing.
The filter is based on the URL to the item and not just the name. To filter by name, use */filename which will match the last part of the URL which is the name.
Leave both fields blank to always be a true condition.
Jump using if/else logic passing all items if there is any true result instead of passing just the true items to the true task, and just the false items to the false task.
Only http and https urls allowed.
Request this file be processed by the Preview function in the CrushFTP prefs.
Parameters : Add Parameter
This class needs to extend the "tasks.Task" class from the CrushTask.jar file in your plugins folder.
Example task :
package tasks;
import java.util.Properties;
import java.util.Vector;
public class BreakpointTask extends Task
{
public BreakpointTask(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);
tracker.put("status", "paused");
CrushTask.Start.checkStatus(tracker, this);
}
catch (Exception e)
{
error = e;
msg(e);
log(false, e.toString(), null);
}
}
}
Variables can be used for filenames, as part of an email address, email body, subject, or event as part of the command for the Execute task.
In the body of an email: <LINE>Text and {variable} items can exist.</LINE> This will result in the line repeating for each item found. (Multiple file upload or download type of event.) {r} is a return character and {n} is a new line character. {task_error} will output the error encountered if any. {task_errors} will output of previous errors encountered if any. File item references:
{url} actual url that points to the file {parent_url} actual url that points to the items parent folder {path} path to the file {parent_path} path to the file {name} name of the file {stem} first part of the name before the dot {ext} end part of the name including the dot {size} size of the file {speed} speed of the transfer {error} error message for the transfer if any {start} start time {end} end time {resume_loc} resume location in file {md5} MD5 hash of the uploaded file {user_dir} the directory the user saw when uploading {real_path} files local path on disk {real_parent_path} files parent folder's local path on disk
Additionally date tags can be used:
{MM} month {dd} day {yy} or {yyyy} year {HH} 24 hour {mm} minute {hh} 12 hour {aa} AM or PM {ss} seconds {S} milliseconds {EEE} weekday abbreviation (Placing a '.' before the item name will result in the current time. A '_' will result in the file items end upload time. Ex: {.S},{_ss})
Here is an example of what you might use this plugin for.
When files are uploaded to your server, you want them backed up to another server, and an email notification sent out letting someone know about the files on the alternate server. So here are the tasks: MakeDirectory: filter=* /archived_{MM}{dd}{yy}/ Copy: filter=* destination:ftp://myuser:pass@192.168.1.65/newFiles/ Move: filter=* destination: /archived_{MM}{dd}{yy}/ Email: filter=*192.168.1.65* |