FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
maintagent.h
1 /***************************************************************
2  Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3  Copyright (C) 2019 Siemens AG
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 
18 ***************************************************************/
19 #ifndef _MAINTAGENT_H
20 #define _MAINTAGENT_H 1
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <libgen.h>
24 #include <unistd.h>
25 #include <string.h>
26 #include <strings.h>
27 #include <ctype.h>
28 #include <getopt.h>
29 #include <errno.h>
30 #include <time.h>
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 
34 #include <libfossology.h>
35 #define FUNCTION
36 
37 /* for DB */
38 extern PGconn* pgConn;
39 extern fo_dbManager* dbManager;
40 
44 #define myBUFSIZ 2048
45 
49 #define MAXSQL 1024
50 
51 /* File utils.c */
52 void exitNow(int exitVal);
53 
54 /* File usage.c */
55 void usage(char *name);
56 
57 /* File process.c */
58 void vacAnalyze();
59 void validateFolders();
60 void verifyFilePerms(int fix);
61 void removeUploads();
62 void removeTemps();
63 void processExpired();
64 void removeOrphanedFiles();
65 void deleteOrphanGold();
67 void reIndexAllTables();
68 void removeOrphanedRows();
70 
71 #endif /* _MAINTAGENT_H */
FUNCTION void removeOrphanedFiles()
Remove orphaned files from the repository (slow) Loop through each file in the repository and make su...
Definition: process.c:258
FUNCTION void removeTemps()
Remove orphaned temp tables from deprecated pkgmettagetta and old delagent.
Definition: process.c:195
FUNCTION void deleteOrphanGold()
Delete orphaned gold files from the repository Loop through each gold file in the repository and make...
Definition: process.c:282
FUNCTION void reIndexAllTables()
reindex of all indexes in fossology database
Definition: process.c:329
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
FUNCTION void vacAnalyze()
Do database vacuum and analyze.
Definition: process.c:65
FUNCTION void removeOrphanedRows()
remove orphaned rows from fossology database
Definition: process.c:357
FUNCTION void verifyFilePerms(int fix)
Verify and optionally fix file permissions.
Definition: process.c:140
FUNCTION void normalizeUploadPriorities()
Normalize priority of Uploads.
Definition: process.c:304
FUNCTION void processExpired()
Process expired uploads (slow)
Definition: process.c:233
The main FOSSology C library.
FUNCTION void validateFolders()
Validate folder and foldercontents tables.
Definition: process.c:87
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:28
FUNCTION void removeOrphanedLogFiles()
Definition: process.c:460
FUNCTION void usage(char *name)
Definition: usage.c:30
FUNCTION void removeUploads()
Remove Uploads with no pfiles.
Definition: process.c:167
void exitNow(int exitVal)
Exit function. This does all cleanup and should be used instead of calling exit() or main() return...
Definition: util.c:1099