If you want per-million scaled bg, use this command together with genomecov:
## Scaling factor for single-end data, counting every mapped read (bitwise flag = 0)
TmpScale=$(bc <<< "scale=6;1000000/$(samtools view -f 0 -c in.bam)")
## Now get the actual bedGraph:
echo '==> RPM scaling factor:' $TmpScale
bedtools genomecov -bga -ibam in.bam -scale $TmpScale | sort -k1,1 -k2,2n > out.bedGraph