Register
It is currently Wed Apr 16, 2014 3:54 pm

bash script to convert, compress


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Dec 27, 2012 7:41 am   

Joined: Thu Dec 27, 2012 7:37 am
Posts: 1
Hi. i am running debian 6.0.6 and i am banging my head to create a simple script that will run periodically (through cron).
i do have a whole lot of wav files in opt/wavfiles and i do need:
-convert them to mp3
-delete the wav files that have been converted to mp3
-compress the files and move the compressed file to /opt/mp3backups. every time there will be a new compressed file.
is there a simple script ready for the job?


Top
 Profile  
 PostPosted: Thu Dec 27, 2012 5:41 pm   

Joined: Fri Jul 30, 2010 3:19 pm
Posts: 6
Code:
bak=/opt/mp3backups

wav=file.wav
mp3=${wav%wav}mp3

if lame "$wav" "$mp3"
then
rm "$wav"
compress "$mp3"
mv "$mp3.z" "$bak"
fi


Top
 Profile  
 PostPosted: Sun Dec 30, 2012 7:17 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 223
Location: London - UK
Hi,

It's kinda pointless to compress mp3 files. mp3 is a form of compression that works great for music. Compressing the mp3 will gain you maybe 2% of the space, likely less, so pointless :)

DW


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP