TEST CRON ON ANY LINUX OS
lookup if dummy cron task is running every minute
$ crontab -e
* * * * * env > /tmp/env.output
$ sudo service cron start
you should see now the env.output
$ ls -l /tmp/
-rw-rw-r-- 1 msen msen 94 Feb 4 08:29 env.output
For Moodle 3.0.2 version
First go to Administration -> Courses -> Backups -> Automated backup setup
- Active (Manual)
- Schedule (check all days)
- Execute at 0:0
- Automated backup storage -> Specified directory for automated backups
- Save to -> /var/moodledata/coursebackup/ (if you choose empty, the courses will get backed up in its own course folder)
- Maximum number of backups kept: 1
- Delete backups older than : Never
- Minimum number of backups kept: None
- Use course name in backup filename: Checked
- Skip hidden courses: Checked
- Skip courses not modified since: 30 days
- Skip courses not modified since previous backup: no check
now edit crontab, run the automated course backup every night at 1:00 am
$ crontab -e
0 1 * * * /usr/bin/php /usr/share/nginx/html/admin/cli/automated_backups.php > /tmp/moodle-automated-course-backup.log 2>&1
The logs are saved on the temp directory /tmp/moodle-automated-course-backup.log
monitor the logs
$ tail -200 /tmp/moodle-automated-course-backup.log
to list the backuped courses in size (MB)
$ ls -l –block-size=M /var/moodledata/coursebackup/*
to lookup the directory size
$ du -sh /var/moodledata/coursebackup/
1.8G /var/moodledata/coursebackup/
How can you backup via CLI only a specific course though? on demand as it were. Thanks
LikeLike