as of right now I have a file called song.mp3 that I have integrated into a Python program which will act as an alarm. I would like it so that whenever I send the Raspberry Pi a new song via Bluetooth, it will just automatically rename this song to be song.mp3, thereby overwriting the previous song. That way I don't have to change my alarm program for different songs. Any help?
Assuming that the mp3 files are all in the same directory, you could perhaps have a cron job running that periodically renames the most recent file and so something like:
mv $(ls -1t *.txt | head -1) song.mp3
This is a quick example. It would be more preferable to add the ablve to a script and add some "belts and braces" to ensure that the script doesn't crash.
Automatically overwrite existing file with an incoming file