Hello, i have a filesync rule to sync a firmware in some android devices and i want to know if there is any way to ckeck if the device has downloaded the zip to perform the update.
Hello, i have a filesync rule to sync a firmware in some android devices and i want to know if there is any way to ckeck if the device has downloaded the zip to perform the update.
Hi Jose,
There would be different ways, let me share two of them that come to my mind directly below:
- You can use File Sync rule advanced settings option, and you can send out a script to the device to create a custom data. And then you can list this custom data value on MobiControl Webconsole, and understand whether the file-sync is completed or not, you can find more information about Custom data steps on here at SOTI Pulse or SOTI Help page. Remember to enable below option.
- or for Android devices if you know the size of the .zip file, you can also use JS to show the size of the file (whether the file is exist on the device side and learn the size of the file); example as below: Source: Home | Android Agent JavaScript (soti.net)
Feel free to comment out for lines for your use case.
// Define the file path
var filePath = '/sdcard/Download/zafer-surf.pcg';
var file = new mobicontrol.io.File(filePath);
// Log messages File size in bytes
mobicontrol.log.info('File size is ' + file.size + 'Byte'); //log message on console Logs
mobicontrol.message.createInfoDialog('File size is ' + file.size + 'Byte').show(); //log message on device screen
// Log the folder size in MB
mobicontrol.log.info('File size is ' + file.size/ 1048576 + 'MB'); //log message on console Logs
mobicontrol.message.createInfoDialog('File size is ' + file.size/ 1048576 + 'MB').show(); //log message on device screen
I hope it helps. Thank you
Zafer
Hello Zafer! great idea, both are very good ideas... i will test them!
You are welcome, Jose!
For 1st option on my previous reply above, you may send out a JS script similar to below on Advanced section of the File-sync to create an .ini file on your device side that consist of some text value, after the filesync is completed you should see .ini file on your device path based on the path that you select; for below example it would be on /sdcard/Download/zafer_custom_data.ini, and via custom data you can read it from MobiControl Webconsole.
#!/usr/bin/env js
var file = new mobicontrol.io.File('/sdcard/Download/zafer_custom_data.ini');
var textContent = "[FileSync]\n FileSync=File Sync Completed";
file.writeText(textContent);
You may see brief steps of the custom data here as well, I shared some screenshots earlier: SOTI Discussion Forum
Zafer
Hi Jose, Echeverria,
Thank you for posting on SOTI Pulse. We'd like to confirm if you've had the opportunity to test the solution proposed by Zafer.
Zafer, we appreciate your prompt response and valuable expertise in addressing the query. Your willingness to assist is highly commendable.
If you have any additional questions or concerns, please don't hesitate to reach out. We're dedicated to providing assistance and support.
Kind regards,
Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |
Hi Zafer,
Im pushing an updated datawedge file to my zebra devices running A11 using the file sync policies. For my post script I have the following post-sync script in place to allow the file to move successfully
Hi Jose,
FYI, in the latest version of Mobicontrol I believe execute action once file synced is being depreciated.
One other option is to select your device and Action -> Sync Files Now
In the Device Log, you will see "Sync Files requested" and shortly after if the Firmware File is synced you will see another log stating "File(s) synchronized (Total 1 files synchronized: 0 files downloaded, 1 files skipped)"
You can also do this on a wider scale and download the logs for the deployment server (as CSV) and filter "Messages" column for the "File(s) synchronized..." Log.
Thanks
Adam
Hi Adam,
Thanks for the info. On my latest version MobiControl environment I can see Pre-Sync/Post-Sync Script settings under Policy -> File Sync -> Script section. And there is Execute Script Only if Files Transmitted feature as well. So, it looks like okay to use either 1st option, or 2nd option that I mentioned on my 1st reply. Do you mean this part, if yes do you use a latest version and can't see this section?
For 2nd option, using a Task scheduler or such would be a good use case as well depending on the scenario. I hope it helps. Thank you
Zafer
My apologies Zafer,
I misread the release notes for MC 2024, server side actions which are performed before filesync will be depreciated.
https://discussions.soti.net/articles/file-sync-rule-server-actions-deprecation
