4 * Copyright 2003 (c) GFDL
8 * This file is part of FMS.
10 * FMS is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * FMS is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FMS; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
23 * -------------- Gforge team comment ------------
24 * This file was proposed by Brett N DiFrischia
25 * with the following description:
26 * The GFDL uses many large files that could not be uploaded to our GForge site.
27 * At this time, such files are updated manually. This cronjob updates file sizes
28 * for all files that have the incorrect size. Note that this cronjob checks all files
29 * instead of recently updated ones. This could put a major damper on large systems.
30 * Updates are only performed for incorrect file sizes.
35 require_once ('squal_pre.php');
40 db_query( "SELECT frs_file.filename,frs_file.file_id,
41 groups.unix_group_name,frs_file.file_size
42 FROM frs_package,frs_release,frs_file,groups
43 WHERE frs_release.release_id=frs_file.release_id
44 AND groups.group_id=frs_package.group_id
45 AND frs_release.package_id=frs_package.package_id
46 AND frs_file.post_date > " .
47 time() - (7 * 24 * 60 * 60)
51 while ( $fms_filesize_row = db_fetch_array( $fms_filesize_res ) ) {
53 $fms_file_path = $sys_upload_dir . '/' .
54 $fms_filesize_row['unix_group_name'] . '/' .
55 $fms_filesize_row['filename'];
57 $fms_curr_size = filesize( $fms_file_path );
59 if ( $fms_curr_size != $fms_filesize_row['file_size'] ) {
60 db_query( "UPDATE frs_file SET file_size='" .
61 $fms_curr_size . "' WHERE file_id='" .
62 $fms_filesize_row['file_id'] . "'" );