Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6546

Re: Mass deleting Course Backups

$
0
0
by Ken Task.  

1.9 backups were either stored in the course ID folder of moodledata and in a backupdata folder ... so /moodledata/#/backupdata/[backup.zip_file]

If running automated backups then they are all in whatever directory the auto backups are pointed to.

In a shell (ssh) and located in the moodledata directory:

ls -lR ?/backupdata/*.zip

will show all the single digit course ID numbered folders backupdata and the zip files contained therein.

Example output:

-rwxrwxrwx 1 apache apache   23830 Aug 27  2009 1/backupdata/backup-k12os-foss-20090827-0940.zip
-rwxrwxrwx 1 apache apache   52643 Mar  8  2012 1/backupdata/backup-k12osfoss-20120308-2303.zip
-rwxrwxrwx 1 apache apache    1615 Oct 24  2008 2/backupdata/backup-sa-20081024-2049.zip
-rwxrwxrwx 1 apache apache 4299038 Mar  8  2012 3/backupdata/backup-mtools101-20120308-2303.zip
-rwxrwxrwx 1 apache apache  158503 Aug 27  2009 3/backupdata/backup-tteksglossaries-20090827-0940.zip
-rwxrwxrwx 1 apache apache   16165 Mar  8  2012 6/backupdata/backup-ma101-20120308-2303.zip
-rwxrwxrwx 1 apache apache    1729 Jun  6  2010 7/backupdata/backup-sa-20100606-1309.zip

For double digt course ID numbered folders:

ls -lR ??/backupdata/*.zip

For triple digit course ID numbered folders:

ls -lR ???/backupdata/*.zip

One could move or copy them to another archive folder.  Below shows copy ... but one could use rm rather than cp -p to remove.  rm will prompt you for yes/no response.

cp -p ?/backupdata/*.zip /home/backups/

repeat for ?? and ???

'spirit of sharing', Ken

 


Viewing all articles
Browse latest Browse all 6546

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>