Ubuntu, sending file through bluetooth
I want to send a file named read.txt
using command: bluetooth-sendto
. It works using the direct command on terminal bluetooth-sendto --device=MACADDR path/to/read.txt
. I want to execute it with this cron job:
*/1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt
But it doesn't work. Redirecting the output of this command results an empty file:
*/1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt>path/to/err.log
Permissions of directories and files are 777. Cronjob is settled for same user that can execute command from command line directly. I also tried sudo crontab -e
, but it didn't work.
From the cron log file:
Jun 16 14:26:01 localhost CRON[2023]: (user) CMD (bluetooth-sendto --device=xx:xx:xx:xx:xx:xx /home/user/read.txt)
Jun 16 14:26:01 localhost CRON[2016]: (CRON) info (No MTA installed, discarding output)
bluetooth-send
is a GUI application and does not work in headless or without a X connection address.
I recommend that you use ussp-push
.
The command will be something like ussp-push 12:34:56:78:9A:BC@ localname remotename