Copy newest 2 files from Ubuntu to Windows server
Hi all,
After creating the backup files both from my MySQL database and my online app, I'd like to backup them into my Windows office server. For that purpose I came up with a script that does all of this but I can't get no copy at all of those files on the server. Here is that bit of the script that I thought should have done that: Code:
find -name 'bck*.tgz' -type f -mmin -10 -exec smbclient \\\sbs\\officeserv\\app_backups -u myuser@officeserv.local -p welcome123 -c "; prompt; put "{}"; exit" \; Code:
find -name 'bck*.tgz' -type f -mmin -10 Can you help me? Thanks |
The basic syntax for coping files via smbclient is
smbclient //host/share -U username -P password -c "put source destination" So to copy files via find is: find -name 'bck*.tgz' -type f -exec smbclient //host/share -U username -P password -c "put {} /{}" \; You can also use a credentials file instead of username password. |
Oops... Not yet...
Thanks, for your support but unfortunatelly it doesn't work.
I even tried to change the / or // by \ or \\ but nothing... Any ideas? |
Other option
It doesn't have to be with 'find', I just want to copy the 2 files that were previously created with the script...
Any ideas? Thanks |
Have you tried copying the files by just using the smbclient command? If so what were the errors?
|
All times are GMT -5. The time now is 05:34 PM. |