I have 3 massive folders containing lots of other folders that I need to give access to a third party for downloading via SFTP.
At the moment every folder in the main directory is set for download rights for SFTP so my idea is to make a list.txt containing the files that the user can not access and set the permissions to something? Or move these files to another folder?
The folder in question will have over 2000 folders containing million of files over 500GB and I need to remove access to half of them
Example folder list
(1) some test (2) more test 1. PLANT Madrid Two 2013 Folio ltd 2014-27 201-07-98 3M 3M 4M 5M 3M Comp LTD 5028 - Video 6398SRTTGDS
I was thinking something along the lines of a bash script that would even move the files to a new folder or change permissions. Any thoughts on what would be best with the amount of data, folders and user will be used SFTP to download the other folders?
while IFS= read -r dir; do mv -t path/to/Deny_folder -R -- "$dir" done < list.txt
while IFS= read -r dir; do chown 700 "$dir" done < list.txt