Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
ca058190
Unverified
Commit
ca058190
authored
Dec 30, 2016
by
David Morley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix config file up like it was
parent
fffe66e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
config.php.example
config.php.example
+2
-2
db/add.php
db/add.php
+1
-1
db/backup.php
db/backup.php
+4
-4
No files found.
config.php.example
View file @
ca058190
<?php
/* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */
//backup directory
$backup_dir
=
'/
var/www/podup/
backup'
;
$backup_dir
=
'/backup'
;
//log directory
$log_dir
=
'/
var/www/podup/
log'
;
$log_dir
=
'/log'
;
//location of pg dump
$pg_dump_dir
=
'/usr/bin'
;
//db username
...
...
db/add.php
View file @
ca058190
...
...
@@ -4,7 +4,7 @@ $valid = 0;
require_once
__DIR__
.
'/../logging.php'
;
$log
=
new
Logging
();
$log
->
lfile
(
'../log/add.php
.log'
);
$log
->
lfile
(
__DIR__
.
$log_dir
.
'/add
.log'
);
if
(
!
$_POST
[
'url'
])
{
$log
->
lwrite
(
'no url given '
.
$_POST
[
'domain'
]);
die
(
'no url given'
);
...
...
db/backup.php
View file @
ca058190
...
...
@@ -3,15 +3,15 @@ require_once __DIR__ . '/../config.php';
$keep
=
(
60
*
60
*
6
)
*
1
;
$dump_date
=
date
(
'Ymd_Hs'
);
$file_name
=
$backup_dir
.
'/dump_'
.
$dump_date
.
'.sql'
;
$file_name
=
__DIR__
.
'/..'
.
$backup_dir
.
'/dump_'
.
$dump_date
.
'.sql'
;
system
(
"export PGPASSWORD=
$pgpass
&&
$pg_dump_dir
/pg_dump --username=
$pguser
$pgdb
>>
$file_name
"
);
echo
"pg backup of
$pgdb
made"
;
$dirh
=
dir
(
$backup_dir
);
$dirh
=
dir
(
__DIR__
.
'/..'
.
$backup_dir
);
while
(
$entry
=
$dirh
->
read
())
{
$old_file_time
=
(
date
(
'U'
)
-
$keep
);
$file_created
=
filectime
(
"
$backup_dir
/
$entry
"
);
$file_created
=
filectime
(
__DIR__
.
'/..'
.
"
$backup_dir
/
$entry
"
);
if
(
$file_created
<
$old_file_time
&&
!
is_dir
(
$entry
))
{
if
(
unlink
(
"
$backup_dir
/
$entry
"
))
{
if
(
unlink
(
__DIR__
.
'/..'
.
"
$backup_dir
/
$entry
"
))
{
echo
'Cleaned up old backups'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment