Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Yum install ncftp
- apt-get install ncftp
- ncftpput -R -v -u "ftp-username" ftp.website.com ftp-upload-path local-path/*
- -R
- find my-dir -exec echo "put /Users/username/"{} {} ;
- #!/bin/bash
- hostname="my-ftp-host"
- username="username"
- password="password"
- ftp -in $hostname <<EOF
- quote USER $username
- quote PASS $password
- binary
- cd 123456
- {COPY THE LIST HERE}
- quit
- EOF
- //Taking source and target directory path
- string sourceDir = FilePath + "Files\" + dsCustomer.Tables[0].Rows[i][2].ToString() + "\ConfigurationFile\" + dsSystems.Tables[0].Rows[j][0].ToString() + "\XmlFile";
- string targetDir = FilePath + "Files\Customers\" + CustomerName + "\" + SystemName + "\";
- foreach (var srcPath in Directory.GetFiles(sourceDir))
- {
- //Taking file name which is going to copy from the sourcefile
- string result = System.IO.Path.GetFileName(srcPath);
- //If that filename exists in the target path
- if (File.Exists(targetDir + result))
- {
- //Copy file with a different name(appending "Con_" infront of the original filename)
- System.IO.File.Copy(srcPath, targetDir + "Con_" + result);
- }
- //If not existing filename
- else
- {
- //Just copy. Replace bit is false here. So there is no overwiting.
- File.Copy(srcPath, srcPath.Replace(sourceDir, targetDir), false);
- }
- }
- enter code here`find my-dir -exec echo "put /Users/username/"{} {} > list.txt ;
- sftp -C -b sftpbatchfile.txt name@server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement