清理分佈

在複製(clone)及發佈之前,下面的命令可以清理MoodleBox並減少它所需磁碟空間:

sudo rm -r /var/www/moodledata/cache/*
sudo rm -r /var/www/moodledata/localcache/*
sudo rm -r /var/www/moodledata/temp/*
sudo rm -r /var/www/moodledata/trashdir/*
sudo rm -r /var/www/moodledata/sessions/*
sudo rm -r /var/cache/moodle/*
sudo rm -r /var/cache/moodle-cache-backup/*
mysql -u root -p'888' moodle -e "truncate table moodle.mdl_logstore_standard_log"
mysql -u root -p'888' moodle -e "truncate table moodle.mdl_config_log"
sudo apt-get clean
sudo rm -r /var/cache/debconf/*
sudo rm -r /tmp/*
sudo rm -r /var/tmp/*
rm ~/.mysql_history
sudo bash -c 'for logs in `find /var/log -type f`; do > $logs; done'
cat /dev/null > ~/.bash_history && history -c && sudo shutdown -h now

如果一切順利,所需的總容量是1.6G,封軌映像檔大約有2.3 GB的大小。壓縮後大約750 MB左右。

Last updated