namityadav
Programmer
I have to write a perl script that will be executed periodically to copy files from a remote server, and will have to do the following:
1. Check the disk space on local server, find out how much free disk space is available for the copying (We can assume that the copying can take 90% of the total free disk space on local server)
2. Use scp to copy the files (Keys are already set) from the remote machine
What we have to note is: Due to performance issues of the ssh tunnels, it'll be better to copy the files over in one go. One possible problem, in that case, is that if there are too many files on remote machine, then we should figure out how many files we can copy ( and what files are those? ).
Earlier I was using a shell script to copy files, but that wasn't taking care of the disk space. So I decided to see if perl can help me. Unfortunately I don't know much about perl. Any suggestions?
1. Check the disk space on local server, find out how much free disk space is available for the copying (We can assume that the copying can take 90% of the total free disk space on local server)
2. Use scp to copy the files (Keys are already set) from the remote machine
What we have to note is: Due to performance issues of the ssh tunnels, it'll be better to copy the files over in one go. One possible problem, in that case, is that if there are too many files on remote machine, then we should figure out how many files we can copy ( and what files are those? ).
Earlier I was using a shell script to copy files, but that wasn't taking care of the disk space. So I decided to see if perl can help me. Unfortunately I don't know much about perl. Any suggestions?