Canvas LMS

Canvas LMS Maintenance

Canvas Instance

> sudo /etc/init.d/canvas_init restart
> sudo /etc/init.d/apache2 restart

Storage Maintenance

Delete immsc archives

> find /data/canvas -type f -name "*.immsc"

Sync Canvas Attachments to OSS

Run rsync in dry-run mode to check which files might be causing the issue:

> rsync -av --dry-run /data/canvas/tmp/files /oss/
> rsync -av /data/canvas/tmp/files /oss/
# or with some exclusions
> rsync -av --exclude=tmp /data/canvas/tmp/files /oss/
> rsync -av --exclude='tmp/*' --exclude='logs/*' --exclude='cache/*' /data/canvas/tmp/files /oss/

Delete User Data Export

Listing files with file size:

> find <canvas_installation_path>/tmp/files -type f -name 'exported_data_cm_*.zip' -exec ls -lh {} +

Find all files larger than 1G in a specific folder:

> find <canvas_installation_path>/tmp/files -type f -size +1G -printf "%s %T+ %p\n" | sort -nr | awk '{printf "%.2f GB %s %s\n", $1/1024/1024/1024, $2, $3}'

Delete files:

> find <canvas_installation_path>/tmp/files -type f -name 'exported_data_cm_*.zip' -print -delete
> find <canvas_installation_path>/tmp/files -type f -name 'course_files_export.zip' -print -delete
> find <canvas_installation_path>/tmp/files -type f -name '*_submissions.zip' -print -delete

If needed, move them to another storage before deletion:

> mkdir -p /backup/canvas_exports
> find <canvas_installation_path>/tmp/files -type f -name 'exported_data_cm_*.zip' -exec mv {} /backup/canvas_exports/ \;

Previous
Docker