diff --git a/README.md b/README.md index bad9f5c..ac7c9b9 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ path-style-access: true backup-date-format: dd-MM-yyyy-HH-mm-ss # Interval in minutes in which to create an automatic backup +# Set to -1 to disable backup-interval: 240 # Name of your s3 bucket diff --git a/src/main/java/cloud/stonehouse/s3backup/S3Backup.java b/src/main/java/cloud/stonehouse/s3backup/S3Backup.java index 559c457..ed7537e 100755 --- a/src/main/java/cloud/stonehouse/s3backup/S3Backup.java +++ b/src/main/java/cloud/stonehouse/s3backup/S3Backup.java @@ -42,9 +42,12 @@ public void onEnable() { Objects.requireNonNull(this.getCommand("s3backup")).setExecutor(new CommandS3Backup(this)); int backupInterval = getFileConfig().getBackupInterval(); - scheduler = new Scheduler(this).runTaskTimer(this, - 20 * 60 * backupInterval, - 20 * 60 * backupInterval); + + if (backupInterval != -1) { + scheduler = new Scheduler(this).runTaskTimer(this, + 20 * 60 * backupInterval, + 20 * 60 * backupInterval); + } setProgress(false); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 50d0f1c..cece0d0 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -19,6 +19,7 @@ path-style-access: true backup-date-format: dd-MM-yyyy-HH-mm-ss # Interval in minutes in which to create an automatic backup +# Set to -1 to disable backup-interval: 240 # Name of your s3 bucket