Skip to content

This Spring Boot app securely backs up selected files via SSH, mirroring folder structures on another computer. Its flexible scheduler, defined by a customizable cron, allows tailored backups. Smartly, it captures only files modified today or yesterday, with an adjustable timeframe. Ideal for efficient and scheduled file transfers.

Notifications You must be signed in to change notification settings

hakimfauzi23/backup-files-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Back Up Files Spring Boot Apps

App Flow

Overview

This Spring Boot app helps you back up files from one computer to another using a secure method called SSH. It also makes sure the folders on the second computer match the original ones. You can set when this backup happens by choosing a schedule, like every day or every week. Plus, it's smart – it only picks files that were changed today or yesterday. And, you can easily change when it considers a file "recently changed."

Features

  • SSH Backup: Securely transfer files between computers.
  • Folder Mirroring: Dynamically create mirrored folder structures.
  • Flexible Scheduler: Customize backup schedules with cron expressions.
  • Smart File Selection: Back up only files modified today or yesterday, adjustable as needed.

Getting Started

  1. Clone the repository: git clone https://github.com/hakimfauzi23/backup-files-worker.git
  2. Navigate to the project directory: cd backup-files-worker
  3. Configure application.properties
## This is source folder that want to backup
source.server.directory=E:/PERSONAL/TEST-FILE

## This is config for destination Backup Server or VM
backup.server.hostname=
backup.server.port=
backup.server.username=
backup.server.password=
backup.server.directory=

## This is config for Rabbit-MQ 
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.queue.name=files_backup_queue
spring.rabbitmq.exchange.name=files_backup_queue_exchange
spring.rabbitmq.routing.key=files_backup_queue_routing_key
spring.rabbitmq.listener.simple.acknowledge-mode=manual

## The apps have two option, Backup files that modified today
## or yesterday, if today so make this prop true, and vice versa
application.backup.today=false

## For settings the scheduler, if the scheduler will run every minutes
## Or every 11 PM etc
application.backup.scheduler.cron=*/20 * * * * *
  1. Start a rabbitMQ Application, here's my command for starting RabbitMQ on docker : docker run --rm -it -p 15672:15672 -p 5672:5672 rabbitmq:3.10.5-management
  2. Build the application JAR File: mvn clean package
  3. Run the application by runnning the JAR File : java -jar backup-files-worker-1.0.0.jar

Dependencies

  • Java Development Kit (JDK) - Required for running the application.
  • Spring Boot - Framework for creating stand-alone, production-grade Spring-based applications.
  • RabbitMQ - RabbitMQ Message broker for producer and consumer style in sending file information that want to upload
  • Java Secure Channel - For SSH Backup the files and also operate SSH command from the app like put, mkdirs, cd, etc.
  • Spring Web - Spring framework for creating and add message converter in Rabbit MQ Purposes.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

This Spring Boot app securely backs up selected files via SSH, mirroring folder structures on another computer. Its flexible scheduler, defined by a customizable cron, allows tailored backups. Smartly, it captures only files modified today or yesterday, with an adjustable timeframe. Ideal for efficient and scheduled file transfers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages