scripts which can replicate one directory to another directory
i have connected two hdd to drive in raspberry pi, one of drive i was using as destination of ftp server where i am dumping all data of ftp server.
So I wanted to be a mechanism which will clone firts dive to second drive.
This script can do that, you can trigred it manually but i was using crontab
execute this script on every night
- go to the file
index.js
, andconst rsyncSource = '/media/pi/main-disk/'; const rsyncDest = '/media/pi/backup-disk';
update these two variable. - install packages with this cmd
npm install
- run script with this cmd
node index.js