我有一组目录,其中包含文件,可与LiquidSoap配合使用,与IceCast2配合使用
当前,每次删除文件或添加文件时,我都必须编辑列出mp3的txt文件以手动播放
我想做的是创建一个脚本或一个cron作业,它会自动创建一个跨文件夹的mp3填充路径的简单列表,该列表每次都会完全重新生成。
我说它需要重新生成,以便从文件中删除已删除的文件
这些文件在目录suck as
/home/user1/files/foo 1/
/home/user1/files/foo 2/
etc...
内容是
this file is called this.mp3
another name for a file.mp3
etc...
我想要一个脚本或cron来创建一个txt文件,该文件的每个文件夹的内容最终都像
/home/user1/files/foo 1/this file is called this.mp3
/home/user1/files/foo 1/another name for a file.mp3
/home/user1/files/foo 1/this is a cool filename.mp3
/home/user1/files/foo 2/moar files.mp3
/home/user1/files/foo 2/okay this is getting old.mp3
但是,如果我删除了/home/user1/files/foo 1/this file is called this.mp3
它,那么它将保留下一代的txt文件,并且如果我将其添加yet another file.mp3
到其中一个文件夹中,那么它将被添加到txt文件中
当前运行Ubuntu Server 13.04,并且能够安装软件包(如果需要的话),尽管很喜欢使用简单的脚本/ crons
见find
:
find "/home/user1/files/foo 1/" "/home/user1/files/foo 2/" > output.txt
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句