#!/usr/bin/perl $transferDir = "/var/lib/mythtv/for_phone/"; #Trailing / is needed! $phoneBDADDR= "00:00:00:00:00:00"; #Add your phone's BDADDR/MAC here. #Get list of files to transfer, one column only: $command = "ls -1 ". $transferDir . "*.3gp"; $list = `$command`; @files = split("\n",$list); for $file (@files) { print "Transfering $file, please wait a long time...\n"; #Re-direct stderr to stdout so perl will get it! $command = "obexftp --bluetooth $phoneBDADDR --put $file 2>&1"; $status = `$command`; #print "status is: $status\n"; if ( $status !~ /failed/ ) { print "Transfer Succeeded, removing $file\n"; system("rm -f $file"); } }