1.0.3 • Published 3 years ago

real-time-backup v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Real Time Backup

Node.js module for real time backup of files and directories.
This is a simple script to backup a directory to a sd card. Only works on Linux.

Version of node.js required: 10.0.0

Example

    const RealTimeBackup = require('real-time-backup');

    // Create a new instance of RealTimeBackup
    const backup = RealTimeBackup().create(
        {
            dirMount: "/media/dir",
            partitionName: "/dev/dir",
            projectDir: "/home/user/project",
            sdCardName: "sdName",
            activeLog: true
        }
    );

    // Start backup
    backup.start();

Methods available

start

  • Start backup
  • return: void

      backup.start();

setCopyToBackup

  • Set the copy to backup => arg: true or false
  • return: void

      backup.setCopyToBackup(true);

isMounted

  • Check if the partition is mounted
  • return: boolean (true or false)

      backup.isMounted();

subscribeIsMounted

  • Subscribe to the event isMounted
  • return: void

      backup.subscribeIsMounted((isMounted) => {
          console.log(isMounted);
      });

unSubscribeIsMounted

  • Unsubscribe to the event isMounted
  • return: void

      backup.unSubscribeIsMounted();
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago