[ZendTo] AutoPickUp
Jules
Jules at Zend.To
Sat May 23 10:41:46 BST 2020
Sean,
Before using any of the scripts, you need to create a user that will be
only used for driving the automation scripts of ZendTo. Don't use a real
user's account, create one just for the purpose.
Put that username in the 'automationUsers' setting in preferences.php.
For this example, let's set a few things:
- The automation user is going to have the username "robot" with a
password of "machines".
- The claimID and passcode of the drop-off will be "aaaClaimIDaaa" and
"bbbPasscodebbb".
- The address of your ZendTo site will be
"https://your-zendto-site.com/". The site address always goes at the
very end of the command, after all the other options.
To see the command-line usage:
/opt/zendto/bin/autopickup --help
Fetch information about the drop-off, without downloading anything:
/opt/zendto/bin/autopickup --username "robot" --password "machines"
--claimid "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --list --nofiles
https://your-zendto-site.com/
Fetch all the files in the drop-off to the current directory, verifying
their checksums, and logging that they were picked up by
"user at yourdomain.com":
/opt/zendto/bin/autopickup --username "robot" --password "machines"
--claimid "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --checksum
--pickedupby "user at yourdomain.com"https://your-zendto-site.com/
Fetch all the files in the drop-off to the directory
"/var/tmp/downloads", not bothering with checksums or logging who did it:
/opt/zendto/bin/autopickup --username "robot" --password "machines"
--claimid "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --output
"/var/tmp/downloads"https://your-zendto-site.com/
The output of the "--list --nofiles" command above will give you a
unique "fileid" number for each of the files in the drop-off. So let's
download file number 123, verify its checksum and save it to the file
"~/Downloads/my-picked-up-file":
/opt/zendto/bin/autopickup --username "robot" --password "machines"
--claimid "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --file 123
--checksum --output
"~/Downloads/my-picked-up-file"https://your-zendto-site.com/
If you are using a locally-signed SSL certificate on your ZendTo server,
you may need to add the option
--insecure
to all of the above examples.
To see the "curl" command it creates, which is what does all the work,
but not actually run anything, add the option
--debug
to any of the above examples.
Does that help?
The point of me using "curl" is that all the script really does is
create all the parameters for an HTTP POST request to your ZendTo
server, and then pull out the JSON results from the right header in the
returned data. The "--debug" option will help you understand what it's
doing.
Once you have played with it a bit, take a look how the script works
(90% is just parsing the command-line!) and you will see how you could
use a .Net http request to achieve the same result with your own code
running on a Windows server.
Cheers,
Jules.
On 22/05/2020 20:25, Cole, Sean via ZendTo wrote:
>
> Is anyone using the AutoPickUp Script? Any documentation on the use
> of the script or examples. Trying to move the files uploaded from the
> ZendTo server to a Windows server.
>
>
> Regards,
>
> *Sean Cole*
>
> Mgr. Network Services
>
> SeanCole at sunywcc.edu <mailto:SeanCole at sunywcc.edu>
>
> 914-606-6923
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://jul.es/mailman/listinfo/zendto
Jules
--
Julian Field MEng CEng CITP MBCS MIEEE MACM
The current UK shipping forecast:
Trafalgar: Northerly or northeasterly 5 to 7, occasionally 4 at first. Rough.
Rain or showers at first. Good, occasionally moderate at first.
www.Zend.To
Twitter: @JulesFM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jul.es/pipermail/zendto/attachments/20200523/c5f5e430/attachment.html>
More information about the ZendTo
mailing list