Hi folks,
I have been looking into this for a small while and I am quite stuck (I am quite new to linux in general).
I have a bunch of 5 network cameras saving their images to a volume called /mnt/Data/Camera2/Cam1, /mnt/Data/Camera2/Cam2, etc....
The cameras themselves do not support putting the images in dated directories so I need the ability for freenas to move the files into an "archive directory" so that the users who have the share added, do not need to map another network drive in windows.
I would like the backups to go to /mnt/Data/Camera2/Archive/<date> on a weekly basis. So far I have come up with the following, but I dont know if it is correct:
I have also tried:
Any help would be much appreciated!!
I have been looking into this for a small while and I am quite stuck (I am quite new to linux in general).
I have a bunch of 5 network cameras saving their images to a volume called /mnt/Data/Camera2/Cam1, /mnt/Data/Camera2/Cam2, etc....
The cameras themselves do not support putting the images in dated directories so I need the ability for freenas to move the files into an "archive directory" so that the users who have the share added, do not need to map another network drive in windows.
I would like the backups to go to /mnt/Data/Camera2/Archive/<date> on a weekly basis. So far I have come up with the following, but I dont know if it is correct:
Code:
#!/bin/bash HOME_DIRS="/mnt/Data/Camera2/archive/Cam1/mnt/Data/Camera2/archive/Cam2 /mnt/Data/Camera2/archive/Cam3 /mnt/Data/Camera2/archive/Cam4 /mnt/Data/Camera2/archive/Cam5" DATE_DIR=$(date +%Y-%m-%d) for FOLDER in $HOME_DIRS; do mkdir -p "${FOLDER}/${DATE_DIR}" done mv /mnt/Data/Camera2/Cam1 /mnt/Data/Camera2/archive/Cam1/${DATE_DIR}
I have also tried:
Code:
rsync -rvuAth --log-file=/mnt/Data/Camera2/weeklymove.log --remove-source-files /mnt/Data/Camera2/Cam1 /mnt/Data/Camera2/archive/Cam1/"date -I"
Any help would be much appreciated!!