folder backup

This commit is contained in:
shimon
2023-03-01 13:45:05 +02:00
parent 0e9286d2f5
commit 3c858caaa2
3 changed files with 10 additions and 7 deletions
+6 -3
View File
@@ -32,7 +32,7 @@ _APP_CONNECTIONS_DB_CONSOLE=db_fra1_01=mariadb://user:password@mariadb:3306/appw
_APP_CONNECTIONS_CACHE=redis_fra1_01=redis://redis:6379
_APP_CONNECTIONS_QUEUE=redis_fra1_01=redis://redis:6379
_APP_CONNECTIONS_PUBSUB=redis_fra1_01=redis://redis:6379
_APP_CONNECTIONS_STORAGE=
_APP_CONNECTIONS_STORAGE=local://localhost
_APP_STORAGE_ANTIVIRUS=disabled
_APP_STORAGE_ANTIVIRUS_HOST=clamav
_APP_STORAGE_ANTIVIRUS_PORT=3310
@@ -67,6 +67,9 @@ _APP_USAGE_STATS=enabled
_APP_USAGE_AGGREGATION_INTERVAL=30
_APP_LOGGING_PROVIDER=
_APP_LOGGING_CONFIG=
_APP_GRAPHQL_MAX_BATCH_SIZE=10
_APP_GRAPHQL_MAX_COMPLEXITY=250
_APP_GRAPHQL_MAX_DEPTH=3
_APP_REGION=default
_APP_DOCKER_HUB_USERNAME=
_APP_DOCKER_HUB_PASSWORD=
DOCKERHUB_PULL_USERNAME
DOCKERHUB_PULL_PASSWORD
+1 -1
View File
@@ -47,7 +47,7 @@
"utopia-php/analytics": "0.2.*",
"utopia-php/audit": "0.20.*",
"utopia-php/cache": "0.8.*",
"utopia-php/cli": "0.14.*",
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.30.*",
"utopia-php/queue": "0.5.*",
+3 -3
View File
@@ -28,9 +28,10 @@ class Backup extends Action
Console::title('Backup V1');
Console::success(APP_NAME . ' backup process v1 has started');
$jobInitTime = '9:55'; // (hour:minutes)
$now = new \DateTime();
$now->setTimezone(new \DateTimeZone(date_default_timezone_get()));
$next = new \DateTime($now->format("Y-m-d 17:25.0"));
$next = new \DateTime($now->format("Y-m-d $jobInitTime"));
$next->setTimezone(new \DateTimeZone(date_default_timezone_get()));
$delay = $next->getTimestamp() - $now->getTimestamp();
@@ -74,6 +75,7 @@ class Backup extends Action
$stderr
);
try {
if (!$local->exists($source)) {
continue;
@@ -81,7 +83,6 @@ class Backup extends Action
$local->transfer($source, $destination, $remote);
Console::info("Backing up local $source to {$remote->getName()} $destination");
/**
* Backup folder, long tail cleanup.
*/
@@ -91,7 +92,6 @@ class Backup extends Action
$now->sub(\DateInterval::createFromDateString('1 days'));
if ($i >= 10) {
$destination = '/' . $key . '/' . $key . '-' . $now->format("Y-m-d") . '.tar.gz';
Console::info("Trying to delete from {$remote->getName()} $destination");
$remote->delete($destination);
}
}