![]() |
|
|
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 |
| sed - searching for string and storing in variable | melias | Shell Programming and Scripting | 4 | 04-12-2008 03:57 PM |
| Problem while storing sql query value in a variable | krishna_gnv | Shell Programming and Scripting | 1 | 02-28-2008 07:37 AM |
| Storing the output into a variable | ravi raj kumar | UNIX for Dummies Questions & Answers | 7 | 12-11-2006 09:14 AM |
| storing output of awk in variable | mab_arif16 | Shell Programming and Scripting | 3 | 05-07-2006 07:15 PM |
| Storing values in variable | matrixmadhan | Shell Programming and Scripting | 1 | 04-01-2005 02:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Storing a variable?
I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time the script runs? Code:
#!/bin/bash DATE=$(date +%d%b%y_%k.%M.%S) cd /web/.hhome/mysql.backup/data mysqldump -ubackup -ppassword --databases db1 db3 > $DATE.backup.sql gzip -9 $DATE.backup.sql crypt key < $DATE.backup.sql.gz > $DATE.backup.sql.enc.gz rm -rf $DATE.backup.sql.gz ftp -inv ftp.somehost.com<<ENDFTP user hoover90 password put $DATE.backup.sql.enc.gz bye ENDFTP I can use pretty much any method, but it has to be done within this bash script. Thanks! Last edited by hoover90; 01-26-2008 at 07:19 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|