Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Converting regular time to CTIME Post 26707 by PGPhantom on Thursday 22nd of August 2002 11:54:25 AM
Old 08-22-2002
ctime conversion

I am actually trying to get a script to move our backup tapes from one system to another and the assigned date / time is in the format ... 02/01/2002 10:13:17 AM. To import the tapes there is a parameter for the assigned time but it needs ctime which, in this case is ... 1012587197.

I know of DTConverter but it does not have any command line switches to automatically perform the task within a script.

If I give the initial format a variable named for e.g. ASSIGNED, how can I use that to get another variable name for e.g. CASSIGNED which will have the inital $ASSIGNED converted to ctime?

Hopefully this makes sense.

Thanks kindly for any help that you can give.

BTW - I am running the sctipt on an NT 2000 server using the UNIX Korn Shell utilities.

Smilie NIce way to make NT useful, install UNIX commands on it...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help converting date-time value to decimal

Hi I need help to do some calculation in script. I have a monitor program (munin) that I would like to log uptime information from a server. The script looks like this (not complete): #!/bin/sh # server_uptime ### Config Start # Reads the server parameters using the HTTP port with... (7 Replies)
Discussion started by: Jotne
7 Replies

2. UNIX for Advanced & Expert Users

problem with converting time using perl

Hello, I have an AIX 5.3 system and i created a script to get the last login of users. The script goes like this: LAST_LOGIN=`lsuser -a time_last_login $cur_user` TIME_LOGIN=`perl -e 'print scalar localtime("$LAST_LOGIN")'` Actually what i do in these two lines is to set a variable... (2 Replies)
Discussion started by: omonoiatis9
2 Replies

3. Shell Programming and Scripting

converting epoch time

Hi, Thanks bartus11 yesterday's code worked fine for me. In meantime I've found another "issue". As you can see highlighted, the time format in my original input in case of two rows which should be duplicited ,is differentwhat I need to do is to convert to this format "20110607-08:03:22"... (4 Replies)
Discussion started by: hernand
4 Replies

4. Shell Programming and Scripting

converting epoch time to ddmmyy format

I can not find a working script or way to do this on sun solaris , can someone please guide me? e.g 1327329935 epoch secs = 012312 (ddmmyy) thanks (5 Replies)
Discussion started by: aliyesami
5 Replies

5. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

6. Shell Programming and Scripting

Converting real time to epoch time

# date +%s -d "Mon Feb 11 02:26:04" 1360567564 # perl -e 'print scalar localtime(1360567564), "\n";' Mon Feb 11 02:26:04 2013 the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input 1359453135154 rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies

7. UNIX for Dummies Questions & Answers

Converting Epoch time

I have a Raspberry Pi that logs some temperatures using Onewire. Data is collected with RRDTool. The command sudo rrdtool fetch ute_temp.rrd AVERAGE -s -1h > ./test.log and then cat test.log gives the result 1388608500: 2.3579639836e+00 . How do I write a script that converts the Epoch time... (4 Replies)
Discussion started by: nilekl
4 Replies

8. Shell Programming and Scripting

Converting a random epoch time into a readable format

I am trying to create a script that will take epoch (input from command line) and convert it into a readable format in bash/shell ---------- Post updated at 08:03 PM ---------- Previous update was at 07:59 PM ---------- #!bin/bash read -p "Please enter a number to represent epoch time:"... (9 Replies)
Discussion started by: sprocket
9 Replies

9. Shell Programming and Scripting

Converting seconds to time

I have a list of time spans in seconds, and want to compute the time span as hh:mm:nn I am coding in bash and have coded the following. However, the results are wrong as "%.0f" rounds the values. Example: ftm: 25793.5 tmspan(hrs,min,sec): 7.16 429.89 25793.50 hh: 7 mm: 10 ss:... (2 Replies)
Discussion started by: kristinu
2 Replies

10. Shell Programming and Scripting

Converting time format as Integer to seconds

Hello, How can we convert date like format 20181004171050 in seconds ? I can able to convert till date but failing for HHMMSS. date -d "20181004" "+%s" output as 1538596800 . But when i add hhmmss it is failing date -d "20181004172000" "+%s" result Invalid date Kindly guide. Regards (16 Replies)
Discussion started by: sadique.manzar
16 Replies
RESTOR(8)						      System Manager's Manual							 RESTOR(8)

NAME
restor - incremental file system restore SYNOPSIS
restor key [ argument ... ] DESCRIPTION
Restor is used to read magtapes dumped with the dump command. The key specifies what is to be done. Key is one of the characters rRxt optionally combined with f. f Use the first argument as the name of the tape instead of the default. r or R The tape is read and loaded into the file system specified in argument. This should not be done lightly (see below). If the key is R restor asks which tape of a multi volume set to start on. This allows restor to be interrupted and then restarted (an icheck -s must be done before restarting ). x Each file on the tape named by an argument is extracted. The file name has all `mount' prefixes removed; for example, /usr/bin/lpr is named /bin/lpr on the tape. The file extracted is placed in a file with a numeric name supplied by restor (actually the inode number). In order to keep the amount of tape read to a minimum, the following procedure is recommended: Mount volume 1 of the set of dump tapes. Type the restor command. Restor will announce whether or not it found the files, give the number it will name the file, and rewind the tape. It then asks you to `mount the desired tape volume'. Type the number of the volume you choose. On a multivolume dump the recom- mended procedure is to mount the last through the first volume in that order. Restor checks to see if any of the files requested are on the mounted tape (or a later tape, thus the reverse order) and doesn't read through the tape if no files are. If you are working with a single volume dump or the number of files being restored is large, respond to the query with `1' and restor will read the tapes in sequential order. If you have a hierarchy to restore you can use dumpdir(8) to produce the list of names and a shell script to move the resulting files to their homes. t Print the date the tape was written and the date the file system was dumped from. The r option should only be used to restore a complete dump tape onto a clear file system or to restore an incremental dump tape onto this. Thus mkfs /dev/hp0a 4807 restor r /dev/hp0a is a typical sequence to restore a complete dump. Another restor can be done to get an incremental dump in on top of this. A dump followed by a mkfs and a restor is used to change the size of a file system. FILES
/dev/rmt1 default file name rst* temporary files SEE ALSO
dump(8), dumpdir(8), mkfs(8) DIAGNOSTICS
There are various diagnostics involved with reading the tape and writing the disk. There are also diagnostics if the i-list or the free list of the file system is not large enough to hold the dump. If the dump extends over more than one tape, it may ask you to change tapes. Reply with a newline when the next tape has been mounted. Dump tapes made before the new ondisc directory structure will be converted automatically by restor . BUGS
There is redundant information on the tape that could be used in case of tape reading problems. Unfortunately, restor does't use it. 3rd Berkeley Distribution RESTOR(8)
All times are GMT -4. The time now is 07:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy