Sponsored Content
Top Forums UNIX for Dummies Questions & Answers After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted Post 302954051 by Khan28 on Thursday 3rd of September 2015 11:37:35 PM
Old 09-04-2015
Linux After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks,

While transferring file from FTP software like Filezilla the files gets corrupted.
Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary but when that particular is used in someother shell script I come to know that it is corrupted.

Regards,
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTP'ed in ASCII a word file, how to recover

This is my worst nightmare in recent years!!! I spent two days writing a proposal due tomorrow, ftp'ed the Word doc to a Unix machine in ASCII mode (i forgot to turn BIN on). Then I was trying to help a colleague download it and I accidently download the ASCII file back to the same dir on my... (1 Reply)
Discussion started by: venkir
1 Replies

2. UNIX for Dummies Questions & Answers

how to check a file to contain only ascii charaters

HI I need to validate a file in UNIX to contain only ascii characters.This is a production issue.Can anyone help with the command? Thanks Subbarao (1 Reply)
Discussion started by: srichakra9
1 Replies

3. Shell Programming and Scripting

ftp - determine ascii or binary file

Hello, How to i determine via ftp commandline if files on ftp server is ascii or binary files. Like every other comon windows ftp program does it automatically. regards Thomas (5 Replies)
Discussion started by: congo
5 Replies

4. UNIX for Advanced & Expert Users

Dynamically ftp'ing a file

Hi, I am having unix script that passes argument value to script. The script finds the file and keeps it in a directory. I need to ftp this file to another server. Please guide me how to acieve this. I am able to connect to ftp server but i am not able to use the unix argument in the ftp... (0 Replies)
Discussion started by: pyaranoid
0 Replies

5. Shell Programming and Scripting

size of a file that iam ftp ing

Hi, I want to compare the size of the files in my local machine before ftp ing it and the size of the file in the remote machine i.e after ftping . SO that the ftp is successful . (3 Replies)
Discussion started by: dineshr85
3 Replies

6. Shell Programming and Scripting

how to check the file data type(ascii or binary)

hi i am receiving a file from one system , i have to verify the format of the file data i.e whether the data is in acii format or binary format, please help thanks in advance satya (1 Reply)
Discussion started by: Satyak
1 Replies

7. Shell Programming and Scripting

How to check if the file has EBCDIC or ascii characters

Hi, is there a way to check if the initial few characters are ebcdic or ascii in a file? (1 Reply)
Discussion started by: ahmedwaseem2000
1 Replies

8. Solaris

UFS File System Periodically Corrupted - What to check?

The system is a SunFire V440 running SunOS 5.10 About once every 3-4 weeks, the system will reboot into single user mode on its own, and then I run svcs -xv, the filesystem service and dependent services will be disabled due to the metadisk file system being corrupted. The I've been doing... (2 Replies)
Discussion started by: the.gooch
2 Replies

9. Shell Programming and Scripting

FTP'ing the zipped file

Hi, I need to have a shell script that FTP's a zipped file from a particular location. I have some path and inside that path i will have folders like x_timestamp and inside x_timestamp there may many folders based upon events like y_111,y_222,y_333.Inside each event there will be another... (3 Replies)
Discussion started by: weknowd
3 Replies

10. UNIX for Beginners Questions & Answers

Check if file is EBCDIC or ASCII format

So, i have this requirement where i need to check the file format, whether it's EBCDIC or ASCII, and based on format retrieve the information from that file: my file is: file1.txt-->this ebcdic file file2.txt-->ascii file i tried below code: file=file1.txt type="`file $file`" i get... (7 Replies)
Discussion started by: gnnsprapa
7 Replies
fwtmp(8)						      System Manager's Manual							  fwtmp(8)

NAME
fwtmp, acctwtmp, wtmpfix - Modify connect time accounting records to change formats and to make corrections in the records SYNOPSIS
fwtmp [-ic] acctwtmp 'Reason' wtmpfix [File . . .] FLAGS
The fwtmp command accepts ASCII records in the type utmp structure format as input. The fwtmp command converts output to type utmp struc- ture formatted binary records. The fwtmp command converts ASCII type utmp structure formatted input records to binary output records. DESCRIPTION
fwtmp [-ic] The fwtmp command reads records from standard input and writes records to standard output. Normally, information in record fields of the /var/adm/wtmp file is entered as binary data by the init and login programs during the life of the /var/adm/wtmp file. These /var/adm/wtmp file records have nine fields formatted according to members of a type utmp structure defined in the utmp.h include file. The fwtmp command is also capable of writing properly formatted ASCII records from standard input into a file when you use the -i flag. Whenever you enter properly formatted ASCII records for conversion to binary records using the -i flag from the standard input device, you must enter data for each field of the 9-field record in the same order as that of type utmp structure members using a space as a field sep- arator. The following table lists record fields in the order they should be entered, the type utmp structure member name, and the purpose and entry character length. The user login name, which must have exactly sizeof(ut_user) characters. The inittab ID, which must have exactly sizeof(ut_id) characters. The device name, which must have exactly sizeof(ut_line) characters. The process ID, which must have 5 decimal places. The type of entry, which must have 2 decimal places. The type of entry may have any one of several symbolic constant val- ues. The symbolic constants are defined in the utmp.h header file. The process termination status, which must have 4 decimal places. The process exit status, which must have 4 decimal places. The starting time, which must have 10 decimal places. The hostname, which must have exactly sizeof(ut_host) characters. All record field entries you make from standard input must be separated by a space. Also you must fill all string fields with blank charac- ters up to the maximum string size. All decimal values must have the specified number of decimal places with preceding 0s (zeros) to fill empty digit positions. The actual size of character arrays can be found in the utmp.h include file. acctwtmp 'Reason' The acctwtmp command is called by the runacct shell procedure to write a utmp formatted record to standard output with the current date and time together with a 'Reason' string (sizeof(ut_line) characters or less) that you must also enter. wtmpfix [File ...] The wtmpfix command is called by the runacct shell procedure to examine standard input or File records in the wtmp format for corrupted date and timestamp entries. Whenever a corrupted entry is detected, the wtmpfix command corrects date and timestamp inconsistencies and writes corrected records to standard output. Whenever the acctcon1 command runs, and a date and timestamp in a /var/adm/wtmp file is incor- rect, an error is generated when the first corrupted entry is encountered. The acctcon1 process is aborted whenever such an error is detected. The wtmpfix command also checks the validity of the name field to ensure that the name consists only of alphanumeric characters, a $ (dol- lar sign), or spaces. Whenever an invalid name is detected, the wtmpfix command changes the login name to INVALID and writes a diagnostic message to standard error. In this way, the wtmpfix command reduces the likelihood that the acctcon2 command may fail. Each time a date is entered (on system startup or with the date command) a pair of date-change records is written to the /var/adm/wtmp file. The first date-change record is the old date, which is entered with the string old time (the OTIME_MSG string) in the ut_line field and the flag OLD_TIME in the ut_type field. The second record is the new date, which is entered with the string new time (the NTIME_MSG string) in the ut_line field and the flag NEW_TIME in the ut_type field. The wtmpfix command uses these records to synchronize all date and time stamps in the /var/adm/wtmp file. The date-change record pair is then removed. RESTRICTIONS
You should not use the fwtmp command to correct connect-time accounting records because the utmp structure format members are not in the correct order for this operation. EXAMPLES
To convert binary /var/adm/wtmp records in type utmp structure format to an ASCII file called dummy.file, enter a command similar to the following: /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file The content of binary file /var/adm/wtmpfile as input is redirected to dummy.file as ASCII output. To convert records in an ASCII type utmp structure formatted file to a binary output file called /var/adm/wtmp, enter an fwtmp command with the -ic flag similar to the following: /usr/sbin/acct/fwtmp -ic < dummy.file > /var/adm/wtmp The content of ASCII file dummy.file as input is redirected to binary file /var/adm/wtmp as output. FILES
Specifies the command path. Specifies the command path. Specifies the command path. Header file defining structures used to organize login information. Database file for currently logged in users. Login/logout database file. RELATED INFORMATION
Commands: acct(8), acctcon(8), acctmerg(8), date(1), runacct(8) Functions: acct(2) delim off fwtmp(8)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy