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

Re: Can't delete user backup files

$
0
0
by Ken Task.  

The error says a possible problem with 2 hints ... the latter is a permissions issue.  What are ownerships/permissions on the moodledata/filedir directory and directories contained therein?

The page which shows the files is rendered from the database ... it is not generated by looking at the actual folders and files (new file system).

Files in the new file system are no longer in human readable form, but rather, a hash named file.  The is no file browser ... not even for System Admin (something Moodle needs to provide).

Only other way ... mysql query - using phpmyadmin or other MySQL tool:

select * from `mdl_files` where `filename` like "%.mbz%"

WIll show all references in the DB for a Moodle 2 backup file - they have a filename extension of .mbz (really a zip).

In the output of the query above, one will see a contenthash column with references like this (example):

b9d74f3c79e504e5685b1558a6384430a6361286

How to use the above info ... with any tool you have to browse files, go to your moodledata folder filedir directory.

Contained therein one will find (as per example above) a b9 directory.  Contained in the b9 directory a d7 directory.  In the d7 directory there will be a file with the name:

b9d74f3c79e504e5685b1558a6384430a6361286

Command line view in this example:

[root@sos filedir]# cd b9
[root@sos b9]# ls
1d  2c  41  d7
[root@sos b9]# cd d7

/var/www/moodle24data/filedir/b9/d7

[root@sos d7]# ls -l
total 1028
-rw-rw-rw- 1 apache apache 881134 Dec 22 19:09 b9d7235573ec258426a2f407733ace3a11d600e7
-rw-rw-rw- 1 apache apache 155763 Jan 30 07:28 b9d74f3c79e504e5685b1558a6384430a6361286

In the example above, one can see the files are owned by apache user and group.  So in this case the pages generated that provide links to them will be found.

One of them, is a moodle 2 backup (.mbz ... which is really a .zip):

[root@sos d7]# file -b b9d74f3c79e504e5685b1558a6384430a6361286
Zip archive data, at least v2.0 to extract

Sorry for the tutorial on how the new file system works (in this case doesn't work).  It might have been enough to simply say ... check permissions/ownerships on moodledata/filedir ... but if there are other file system issues which might arrise later, at least you kinda know where to look and how now.

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6548

Trending Articles