|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Script generates unique filname automagically?
Hi everyone,
I need to write a script that executes a command with one of the paramaters (filename) being uniquely generated at script execution time. Something to the extent of: pgdump -f DBxxxxxx DBNAME I just need to be able to put that xxxxxx part in dynamically, possibly based on date/time. Any ideas? --Tim |
|
#2
|
|||
|
|||
|
it's depending of what 'a script' is...
in a shell use: xxx.YYYYMMDDHHmmSE.PID (i hope you are familiar) this takes a week but it works. if it's not a stupid shell, but a program (c, c++, perl ...) you sure can find a function called 'mktemp' or 'mkstemp' google 4 man pages ![]() |
|
#3
|
|||
|
|||
|
Quote:
I just created the following script: Code:
_base_path="dbexport" _file_date=`date +%Y%m%d%H%M%S` pg_dump -f "$_base_path/ETADB.$_file_date.$$" ETADB pg_dump -f "$_base_path/MNDB.$_file_date.$$" mn This dumps two databases I need into something archiveable on a daily basis. Thanks, --Tim |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Script generates unique filname automagically? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|