![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| scp automated script | gholdbhurg | UNIX for Advanced & Expert Users | 5 | 10-27-2008 01:23 AM |
| How to execute script one by one in automated env | madhusmita | Shell Programming and Scripting | 1 | 07-02-2008 06:16 AM |
| i want automated script | arghya_owen | Shell Programming and Scripting | 3 | 06-16-2008 10:02 AM |
| Need help for automated shell script | uneex | Shell Programming and Scripting | 4 | 05-01-2008 01:15 PM |
| help for automated script | splax | UNIX for Advanced & Expert Users | 4 | 12-26-2006 05:36 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, Ok, i'm trying to automate sending a DB backup from a linux box to a remote Windows PC via FTP. I can connect, send the file and create a folder, however I require that the backups be differentiated by date. Here is what my script looks like: Code:
open *.*.*.* user username password lcd /location/of/DB/backup mkdir %Y/%m/%d cd %Y/%m/%d put test.txt bye quit This does not work, its just creates a folder named "%Y" with a folder inside it called "%m" with a "%d" folder inside that. How would I go about creating folders with the date structure above on a the remote windows machine? All advice and help appreciated. |
|
||||
|
Try something like this: Code:
#!/bin/sh Y=`date "+%Y"` m=`date "+%m"` d=`date "+%d"` cd /location/of/DB/backup ftp -i -n <<EOF open "hostname" user "user" "passwd" mkdir "$Y"/"$m"/"$d" cd "$Y"/"$m"/"$d" put test.txt quit EOF Regards Last edited by Franklin52; 07-09-2008 at 01:47 PM.. |
|
||||
|
Quote:
![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|