![우분투, 블루투스를 통해 파일 보내기](https://rvso.com/image/1496904/%EC%9A%B0%EB%B6%84%ED%88%AC%2C%20%EB%B8%94%EB%A3%A8%ED%88%AC%EC%8A%A4%EB%A5%BC%20%ED%86%B5%ED%95%B4%20%ED%8C%8C%EC%9D%BC%20%EB%B3%B4%EB%82%B4%EA%B8%B0.png)
read.txt
다음 명령을 사용하여 이름이 지정된 파일을 보내고 싶습니다 bluetooth-sendto
. 터미널에서 직접 명령을 사용하여 작동합니다 bluetooth-sendto --device=MACADDR path/to/read.txt
. 다음 cron 작업으로 실행하고 싶습니다.
*/1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt
하지만 작동하지 않습니다. 이 명령의 출력을 리디렉션하면 빈 파일이 생성됩니다.
*/1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt>path/to/err.log
디렉토리와 파일의 권한은 777입니다. Cronjob은 명령줄에서 직접 명령을 실행할 수 있는 동일한 사용자로 설정됩니다. 나도 시도했지만 sudo crontab -e
작동하지 않았습니다.
크론 로그 파일에서:
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)
답변1
bluetooth-send
GUI 응용 프로그램이며 헤드리스 또는 X 연결 주소 없이는 작동하지 않습니다.
를 사용하시길 권장합니다 ussp-push
. 명령은 다음과 같습니다ussp-push 12:34:56:78:9A:BC@ localname remotename