How do I use a script to copy over a file I have already uploaded to the file server?

Greetings all,

I know the file I have on the file server (android plus file sync rule) syncs to my tablets but on some occasions I'd like to be able to manually sync this file via a script. After reading this, I've tried running the following script on my tablet but it doesn't appear to be working (copying the file over). What am I doing wrong?

ftp get %ROOT%\Guidebook_BCLS_0.epub %sdcard%/eboox_books

Thanks for your time!

** Update **

When I look in the logs I see the following:

"Error message received from device (ftp command encountered unknown problem.)"

Hmm.. not too helpful it sounds.

Also the source I got from the file sync rule which lists the "Server File / Folder Name" as:

"%ROOT%\Guidebook_BCLS_0.epub"

Edited 4 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
4 years ago

Did you actually use %ROOT% in your script?   If so, have you checked what is the actual value of %ROOT% in your case?  You should prefix the argument with FQDN/IP-address of your ftp address and/or port.

Have you checked your firewall configurations to ensure the connection is OK?

What about the file/directory access permissions for the file "Guidebook_BCLS_0.epub", and the ftp server confgurations on your file server?

RO
Ryan O.
4 years ago

Hi Raymond,

Thanks for the reply.

Regarding your questions:
1) Did you actually use %ROOT% in your script?
Yep I did. The script I'm using as mentioned above is "ftp get %ROOT%\Guidebook_BCLS_0.epub %sdcard%/eboox_books".

2) If so, have you checked what is the actual value of %ROOT% in your case?  
When I open "Files by Google" on the tablet I'm assuming its the root of the "internal storage". The tablet has no other SD cards you can add/subtract so that should be it. Let me know if you have a way to explicitly check this value.

3) You should prefix the argument with FQDN/IP-address of your ftp address and/or port.
As I'm getting the file from MobiControl's file sync, how does one get this for their ftp server?


4) Have you checked your firewall configurations to ensure the connection is OK?
Our tablets are connecting to WIFI that is not blocked by firewalls. If you're talking about say the "Network Restriction" section for the "File Synchronization Options" for file sync, then those are set to: "Allow: LAN, WiFi, Cellular, Cellular While Roaming"

 
5) What about the file/directory access permissions for the file "Guidebook_BCLS_0.epub", and the ftp server confgurations on your file server?

Under Rules > Android Plus > File sync > [our specific sync job] I don't see any mention of access permissions for this job. Where does one access the ftp server configurations in this case?

Thanks for your time,

Ryan O.

RC
Raymond Chan Diamond Contributor
4 years ago

From your answers, it is obvious that you have confused file-sync rule with ftp script command. You can manually initiate a file-sync operation right away on targeted device(s) from the device's action menu.

For ftp script command,  the domain/IP-address of the ftp server as well as the precise location of the device directory should be clearly specified.

RO
Ryan O.
4 years ago

Ah I see. I just found the "Sync Files Now" action button and starred it. Thanks.

Regarding "it is obvious that you have confused file-sync rule with ftp script command." just to confirm, I can't use ftp commands with files I've uploaded via file sync rules (that is they're mutually exclusive)?

If they are incompatible, so I understand how this works, does Soti Mobicontrol have a means to act as an FTP server on its end or would I need to create an external one (if I wanted to pursue using script commands that utilize ftp)?

-Ryan O.