Copy files into current dated folder
I had a major previous issue moving files from Linux to a Windows shared folder. This is the code that resolved my issue, using Expect:
#!/bin/bash
expect -c "
spawn scp -p file.xlsx exg85@hostname://export/home/exg85/reports/destinationoffile
expect "assword"
send "mypswd\r"
expect "reports]$"
spawn scp -p file2.xlsx exg85@hostname://export/home/exg85/reports/destinationoffile
expect "assword"
send "mypswd\r"
expect "reports]$"
send "exit\r"
interact "
Now, I would like to autogenerate a folder that would be named the current date and move the file into this folder on a daily basis.
|