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.
Can you clarify the process you're following on the receiving device, for the direct command and for the Cron job?
On the receiving device i'm not following any process. When I send the the file through command line it works fine and the other board receives the file.
Also sure that crontab can find the bluetooth-sendto command? Crontab can have a different path variable than you. http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work
I also tried to put the command in a script and then try to launch that, but it doesn't work. I tried with other commands but I don't have this problem with them. Can still be a problem of the path?
From the log file of the crontab: Jun 16 14:26:01 localhost CRON[2023]: (udooer) CMD (bluetooth-sendto --device=xx:xx:xx:xx:xx:xx /home/udooer/send.txt) Jun 16 14:26:01 localhost CRON[2016]: (CRON) info (No MTA installed, discarding output)
Bluetooth-sendto is a GUI tool, it displays a transfer dialog. Perhaps that is why it is not working with cron that has no gnome display. You could have a look at this https://hanishkvc.wordpress.com/200...mmandline-bluetooth-in-any-new-linux-distros/
Thank you so much. This command solve my problem: obexftp –-nopath –-noconn –-uuid none –-bluetooth <BTAddr> –-channel <OPUSHChannelNo> –put <FileToPut>. Do you know if the channel is fixed or if it changes every time I shut down the device?
Yesterday all worked well, now I'm getting this error: Suppressing FBS. Connecting..\done Tried to connect for 536ms Sending "/home/user/send.txt"...|failed: /home/user/send.txt The operation failed with return code 67 Disconnecting../done Help?