@aubrey
To schedule a Teradata query in crontab, you can follow these steps:
1 2 3 4 5 6 7 |
#!/bin/bash bteq <<EOF .LOGON <hostname>/<username>,<password>; <your_teradata_query_here> .LOGOFF; .QUIT; EOF |
Replace <hostname>
, <username>
, <password>
, and <your_teradata_query_here>
with the appropriate values for your Teradata system and query.
1
|
chmod +x run_query.sh |
1
|
crontab -e |
1
|
0 8 * * * /path/to/run_query.sh |
Replace /path/to/run_query.sh
with the actual path to the shell script you created in step 1.
Now, the Teradata query will be executed automatically at the scheduled time specified in the crontab file.