BigBlueButton录像文件太多,Ubuntu Server硬盘不够怎么办?

使用BigBlueButton时开启了录制功能,时间一久就发现空间不够用了,于是先用最基本的操作,删掉已外理过的录音文件来清理出空间:

1. 清理Log
  sudo bbb-conf –clean
2.  删除旧的录像、文档、
   /etc/cron.daily/bigbluebutton
删除 `exit 0` 行来启用自动清理
清理项有:
find /var/bigbluebutton -maxdepth 1 -type d -name “*-*” -mtime +11 -exec rm -r ‘{}’ \;
find /usr/share/red5/webapps/video/streams -name “*.flv” -mtime +1 -exec rm ‘{}’ \;
find /var/bigbluebutton/deskshare -name “*.flv” -mtime +1 -exec rm ‘{}’ \;
find /var/freeswitch/meetings -name “*.wav” -mtime +1 -exec rm ‘{}’ \;
3.  删除已处理过的wav文件
sudo find /var/bigbluebutton/recording/process -name “*.wav” -exec rm ‘{}’ \;
这样做了之后能撑一段时间,可是时间久了又不够了,第一个念头就是加一块硬盘,然后把BigBlueButton默认的录像存放路径修改到新的硬盘上。
由于BigBlueButton本身没有提供修改录像文件路径的命令,于是我把BigBlueButton录制、处理、存储、回放的整个过程都详细研究了一遍,把这个过程中我认为所有涉及到路径的代码都给改了,可是最终还是不成功,实在找不出问题出在哪里,只能放弃了这个方案。不过可以把这个过程先记录下来,以做参考,想看较为可行的方案的可以跳过这部分:

录像与回放功能目录结构

/usr/local/bigbluebutton/
└── core
    ├── Gemfile
    ├── Gemfile.lock
    ├── lib
    │   ├── recordandplayback
    │   │   ├── audio_archiver.rb
    │   │   ├── deskshare_archiver.rb
    │   │   ├── events_archiver.rb
    │   │   ├── generators
    │   │   │   ├── audio_processor.rb
    │   │   │   ├── audio.rb
    │   │   │   ├── events.rb
    │   │   │   ├── matterhorn_processor.rb
    │   │   │   ├── presentation.rb
    │   │   │   └── video.rb
    │   │   ├── presentation_archiver.rb
    │   │   └── video_archiver.rb
    │   └── recordandplayback.rb
    └── scripts
        ├── archive
        │   └── archive.rb
        ├── bbb-rap.sh
        ├── bigbluebutton.yml
        ├── cleanup.rb
        ├── process
        │   ├── README
        │   └── slides.rb
        ├── publish
        │   ├── README
        │   └── slides.rb
        ├── rap-worker.rb
        └── slides.yml

最终录像回放存放目录

  • /var/bigbluebutton/published/slides/<meeting-id> 
修改录像与回放目录:
把原有的录像路径下所有文件与目录拷到目标路径,如/mnt下
sudo cp -a /var/bigbluebutton /mnt/
则新的录像与回放目录为:/mnt/bigbluebutton

sudo vi /usr/local/bigbluebutton/core/scripts/slides.yml

修改其中的publish_dir
sudo vi /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
修改其中的recording_dir published_dir raw_deskshare_src raw_presentation_src
sudo vi /usr/local/bigbluebutton/core/scripts/cleanup.rb
修改其中的PUBLISHED_DIR UNPUBLISHED_DIR RECORDING_DIR
sudo vi /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
修改其中的presentationDir BLANK_SLIDE BLANK_THUMBNAIL recordStatusDir publishedDir unpublishedDir
使用下面这条命令前先把地址修改为想要修改的地址,以便网络用户有权限访问该位置的内容
sudo chown -R tomcat6:tomcat6 /mnt/bigbluebutton/playback/
sudo vi /etc/bigbluebutton/nginx/slides.nginx
修改其中的地址
sudo chown tomcat6 /mnt/bigbluebutton
修改目录所有者
sudo bbb-conf –clean
折腾了半天,结果还是无法正常录像,重启服务器也没用,只能换个思路了。左思右想,想出了这么一个办法:
  1. 把 /var/bigbluebutton目录内的文件移动到别处
  2. 新增一块硬盘挂载到/var/bigbluebutton目录
  3. 用ls -ld /var/bigbluebutton查看一下目录权限,所有者是否为tomcat6
  4. 如果不是则修改为tomcat6
  5. 把移到别处的文件拷回/var/bigbluebutton下
  6. 在sudo vi /etc/fstab中新建条目以便每次重启时自动加载

附上挂新硬盘的方法:

查看移动硬盘
sudo fdisk -l
挂载
sudo mount -t ext4 /dev/sdb1 /var/bigbluebutton
注:如果是fat32格式的则用-t vfat参数,如果是ext3格式的则用-t ext3参数,/dev/sdb1改为你要挂载的硬盘的实际名称
设置重启后自动挂载
sudo vi /etc/fstab
在该文件中添加:
/dev/sdb1        /var/bigbluebutton       ext4    defaults        0       0

由于BigBlueButton当前版本对于录像的存储、发布等功能还是非常不完善,只能先这样处理了。

当硬盘再次满了的时候还会面临新的问题。再加一块的话要么加一块更大的硬盘,把原有的录像文件复制到新的硬盘上;要么就制定一个规则,把超过一定时间的录像文件删掉,腾出新的空间来用。

ubuntu下wine中文乱码的简单解决方法

公司里传文件用一个叫“飞鸽传书”的软件,但有时我有些工作(比如用planner)得在ubuntu里完成,这样在给同事传 文件的时候就有点麻烦了。本来把飞鸽传书的那个文件ipmsg.exe拷过来,在wine里运行就应该可以了,但是我习惯用英文界面,这样wine的中文乱码这个经典问题就出现了。网上搜一搜大多都是说要拷字体,链接字体,还有删注册表键值什么的。都试过了,对ipmsg没用。最后用了一个简单的方法给解决了。分享一下:

  1. 在屏幕上方panel的空白处点右键,选择Add to Panel…,弹出Add to Panel的窗口。
  2. 在窗口中选择Custom Application Launcher,单击Add,弹出Create Launcher窗口。
  3. Name可以随便填,比如我填入IP Messenger。
  4. 在Command那一行先点Browse…在弹出的窗口中找到ipmsg.exe或者你想要用的其它windows程序,点Open回到Create Launcher窗口,在Command后的框里就填入了刚才找到的程序的路径。
  5. 这时在这个路径前面加上”env LANG=zh_CN.UTF-8 wine “,注意代码最后的wine之后有一个空格不能丢了。
  6. 然后点OK然后Close就可以了。
  7. 这时在Panel上单击出现的图标即可运行,并且也没有乱码了。(使用“飞鸽传书”的话会有错误提示,点“确定”就可以,我这里会连着弹出3次,“确定”之后不影响程序使用。)

Ubuntu下修改hosts解决xmarks被墙

我就不骂闲街了,大家都明白,骂了也没用。

刚升级ubuntu9.10不久,不能用xmarks真让人恼火,下面是解决办法:

#sudo gedit /etc/hosts

然后再加入下面的IP,保存即可。

#xmarks
64.147.188.86 www.xmarks.com
64.147.188.92 api.xmarks.com
64.147.188.89 login.xmarks.com
64.147.188.87 sync.xmarks.com
64.147.188.86 static.xmarks.com
64.147.188.86 download.xmarks.com
64.147.188.86 my.xmarks.com

如果还不行就在xmarks的设置里选高级,再选择“全部加密”,接着应该就可以同步了。

Using SCIM in English interface

惭愧啊,在ubuntu里搞定中文输入法竟然花费了近一天的时间。其实如果是把语言设置为中文的话也没那么多麻烦。只是我个人偏好英语的界面(再说ubuntu的中文界面下字体很难看),问题就出在这里了。只要切换到英语的界面,scim就不管用了。在网上看到了解决办法:

先用这句来安装im-switch和scim

sudo apt-get install im-switch scim

然后用下面两句来进行设置:

sudo im-switch -s scim -z all_ALL
im-switch -s scim -z all_ALL

结果我的问题就出在这里了,其实有错误提示,但我一直没有看到,提示内容是:

No system wide default defined just for locale en_US .
Use "all_ALL" quasi-locale and set IM.
update-alternatives: Cannot find alternative `/etc/X11/xinit/xinput.d/scim’.

没注意这里的提示我还到处找别的原因,又试着装了fcitx,接着卸了又装,装了又卸,还手动修改/usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules,都不起作用。直到看到错误提示,才想起,原来是要update-alternatives。用下面这句:

update-alternatives –install /etc/X11/xinit/xinput.d/all_ALL xinput-all_ALL /etc/X11/xinit/xinput.d/scim 30

完了之后再用上面那两句来设置,没有错误提示了,重启就OK了。

Ubuntu (pronounced “oo-boon-too”)

Ubuntu is a South African ethical ideology focusing on people’s allegiances and relations with each other. The word comes from the Zulu and Xhosa languages. Ubuntu (pronounced "oo-boon-too") is seen as a traditional African concept, is regarded as one of the founding principles of the new republic of South Africaband is connected to the idea of an African Renaissance.

A rough translation of the principle of Ubuntu is "humanity towards others". Another translation could be: "the belief in a universal bond of sharing that connects all humanity".

         "A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed."

Archbishop Desmond Tutu

As a platform based on Linux, the Ubuntu operating system brings the spirit of ubuntu to the software world.

(Above is from the document "About Ubuntu")