Backup your object storage with a bulk download or a smart download based on a history.
inside simple-download folder
-
Run
npm i
to install all the dependencies. -
Inside .env file write your credentials
-
Run
npm run start
ornode index.js
to start the app
Then you will see the total number of files inside that bucket and the total bytes size of these files.
Your files will be downloaded inside a folder name backup-[bucket name]-[timestamp of the download]
inside download-with-history
-
Run
npm i
to install all the dependencies. -
Inside .env file write your credentials
-
Run
npm run start
ornode index.js
to start the app and then for the first run just hit enter for the next two questions.
Firstly it will work just like the simple-download script.
This script will create:
- a folder with the following name backup-[bucket name]-[timestamp of the download]
- a json file with the following name history-[bucket name]-[timestamp of the download].json
Inside the json file will be stored the names of the files downloaded.
Now if you want to backup your object storage again you can use these files and only the newly added files will be downloaded.
TIP Change the name of the folder from backup-[bucket name]-[timestamp of the download] to simply backup
Now run the script again. And you can see that the script downloaded only the newly added files from the object storage (in our case - no new file was added)
If you want to test this and in order to see that it will only download newly added files, use one of these two options:
- delete one item from the .json file and then delete it from the backup folder and run the script again
- add a new image on the storage