Sponsored Content
Full Discussion: Error in the script
Top Forums Shell Programming and Scripting Error in the script Post 302186699 by krworks on Thursday 17th of April 2008 11:52:22 PM
Old 04-18-2008
Script for zipping

Hi,

I've edited the code.


#!/bin/ksh

cd /home/rt/Test_Zip

z=`ls *.log`

for i in $z
do
gzip $i > "$i"_`date +%m%d%y`.gz
done



Now there is no error,
Now the new problem is-
say I've 4 files test1,test2,test3,test4(All are log files),
the above code results in 8 zip files(replacing original files),
among the 8, 4files are with datestamp having size 0 and other 4 are with variable size names without datestamp.

Why is it happening so?

Last edited by krworks; 04-18-2008 at 01:47 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

2. Shell Programming and Scripting

Script with error output but continuation in script?

I have written a basic fetching script. The script logs into an FTP site, downloads a .zip file, then unzips and moves the files to the necessary folders, then deletes them, etc. The problem I have is if one of the files no longer exists on the FTP site or another part of the script fails, then... (3 Replies)
Discussion started by: daem0n
3 Replies

3. Windows & DOS: Issues & Discussions

Error opening script file - location error

Hello, I know nothing about UNIX, ftp, etc. I am building an excel VBA macro which calls a .bat file. I've taken a pre-existing batch file and am trying to modify it to fit my purposes. I would be very grateful for some assistance. Here is my .bat file: echo off set... (9 Replies)
Discussion started by: starcraftbud
9 Replies

4. Shell Programming and Scripting

How to grep sql error in shell script and exit the script?

I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts. Here is my script #!/bin/csh -f source .orapass set user = $USER set pass = $PASS cd /opt/data/scripts echo... (2 Replies)
Discussion started by: allinshell99
2 Replies

5. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

6. UNIX for Dummies Questions & Answers

Re: Script Error [syntax error at line]

Hi , I Have Written A Simple Script To Check Greatest Of '2' Number When Execuating The Script I Am Getting The Below Error SP11: if:not found SP11: line 4:syntax error at line 5:'then' unexpexted And The Program I Have Wrriten For This #!bin/ksh echo "Enter Two Numbers"... (3 Replies)
Discussion started by: anudeepkumar123
3 Replies

7. Shell Programming and Scripting

Error in calling a shell script from another script

HI, We are using two shell scripts, script.sh,env.sh, where env.sh will be called inside script.sh. The variable inside env.sh is used as $var in script.sh.But while running the script its not identifying that variable. Is there any permission needed to call a script inside another script. ... (3 Replies)
Discussion started by: banupriyat
3 Replies

8. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

9. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

10. Shell Programming and Scripting

Shell script with sql script error

Hi All when I execute from psql prompt, I get the result, when I try to automate using a shell script, the query is not working # `/usr/bin/psql -U postgres -d coba1 -c "select name from users where "Date" > current_date - 30;"` ERROR: column "Date" does not exist LINE 1: select... (2 Replies)
Discussion started by: srilinux09
2 Replies
AMFLUSH(8)						  System Administration Commands						AMFLUSH(8)

NAME
amflush - flush Amanda backup files from holding disk to tape SYNOPSIS
amflush [-b] [-f] [-s] [-D datestamp] [-o configoption...] config [host [disk...]...] DESCRIPTION
Amflush writes Amanda backups from the holding disks to tape, and updates the Amanda info database and tapelist(5) accordingly. It is similar to amdump, but does not perform any backup operations on Amanda clients. Backups may stay in a holding disk when something is wrong with the tape at the time amdump is run. When this happens, the problem must be corrected and amflush run by hand. The command optionally takes a set of DLE specifications (see amanda-match(7)) to narrow the DLEs for which dumps will be flushed. All dumps in holding are flushed if no expressions are given. OPTIONS
-b Run amflush in batch mode. All datestamps are selected unless specified. The flush is started without confirmation. -f Run amflush in foreground. Amflush normally detaches itself from the tty and runs as a background process. With the -f option, amflush stays in the foreground. This is useful if amflush is run as part of another script that, for example, advances the tape after the flush is completed. -s Write log to stdout/stderr instead of the amflush log file. Requires the -f option. -D datestamp specify a datestamp expression you want to flush; see amanda-match(7) for details on the format of this expression. -D 20001225-7 will flush all dumps from 25 december 2000 to 27 december 2000. host [disk]* Specify the host and disk on which the command will work -- see the description of DLE specifications in amanda-match(7). -o configoption See the "CONFIGURATION OVERRIDE" section in amanda(8). You can specify many host/disk expressions, only disks that match an expression will be flushed. All disks are flushed if no expressions are given. see the "HOST & DISK EXPRESSION" section of amanda(8) for a description. Amflush will look in the holding disks specified by the amanda.conf file in /usr/local/etc/amanda/config for any non-empty Amanda work directories. It then prompts you to select a directory or to process all of the directories. The work directories in the holding disks are named by the date at the time amdump was run, e.g. 19910215. See the amanda(8) man page for more details about Amanda. EXAMPLE
Amflush will search for holding areas associated with the daily configuration. After you select which holding area to flush, amflush writes the data to tape, updates the databases and sends a mail report similar to amdump(8). % amflush MyConfig Scanning /amanda-hold... 20001113: found Amanda directory. 20001114: found Amanda directory. Multiple Amanda directories, please pick one by letter: A. 20001113 B. 20001114 Select directories to flush [A..B]: [ALL] all Flushing dumps in 20001113, 20001114, today: 20001117 to tape drive /dev/rmt/0mn. Expecting tape DMP014 or a new tape. (The last dumps were to tape DMP013) Are you sure you want to do this? yes Running in background, you can log off now. You'll get mail when amflush is finished. The following example causes amflush to flush everything to tape, then ejects tape, using 'at' to run the task in the background. % echo 'amflush -b -f MyConfig && mt offline' | at now EXIT CODE
The exit code of amflush is the ORed value of: 0 = success 1 = error 4 = a dle failed 8 = Don't know the status of a dle (RESULT_MISSING in the report) 16 = tape error or no more tape SEE ALSO
amanda(8), amdump(8), amanda-match(7) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
James da Silva <jds@amanda.org> Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.1 02/21/2012 AMFLUSH(8)
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy