Skip to content

Commit

Permalink
looks good!
Browse files Browse the repository at this point in the history
  • Loading branch information
NACHC-CAD committed Dec 22, 2022
1 parent ba2a12b commit b5ef663
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ public static void main(String[] args) {
writer.append("\n-- DONE WITH MONTHLY CLONE");
}
}
// delete older daily backups
DeleteOlderThanOneMonth.exec(writer);
if(monthlyTargetDir != null) {
// delete older daily backups
DeleteOlderThanOneMonth.exec(writer);
}
writer.flush();
writer.close();
log.info("Done!");
Expand All @@ -75,7 +77,7 @@ private static File getTargetDir() {
private static File getMonthlyTargetDir() {
String targetDir = GithubBackupAppProps.getTargetDir();
String today = TimeUtil.format(TimeUtil.getNow(), "yyyy_MM_dd");
if(today.endsWith("01") == false) {
if(today.endsWith("22") == false) {
return null;
}
log.info("Today: " + today);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void exec(BufferedWriter writer) {
String fileName = file.getName();
log.info("FILE: " + fileName);
writer.append("\nFILE: " + fileName);
if("MONTHLY".equals(fileName) == false && "github-backup".equals(fileName) == false && file.isDirectory() && fileName.contains(thisMonth) == false && fileName.contains(lastMonth) == false) {
if("MONTHLY".equals(fileName) == false && "github-backup".equals(fileName) == false && file.isDirectory() && fileName.contains(thisMonth)) {
log.info("!!!REMOVING!!!");
writer.append("\n!!!REMOVING!!!");
FileUtil.rmdir(file);
Expand Down

0 comments on commit b5ef663

Please sign in to comment.