Sponsored Content
Full Discussion: Backup of today's file
Top Forums Shell Programming and Scripting Backup of today's file Post 302167274 by namishtiwari on Thursday 14th of February 2008 12:58:10 AM
Old 02-14-2008
Quote:
Originally Posted by Perderabo
What does "make the content 0" of a file mean?
echo 0 > $file
is what occurs to me, but I think it's unlikely that you want to to that.
The content of the file need to be 0 because today's file can grow up to a very large size,we need not to delete the file, because the server will pick these files and then again start writing in them,(if we delete the files then we need to start and stop the server again n again)files can be made 0 with this

cat /dev/null >$file
or >$file

this is done through a cron job.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Check backup file size on backup tape

Hi, I performed backup on tape and I want to append more files to my previous backup on the same backup tape. But before I do that I need to know the backup file size of the first backup I performed so that I know the available size on the backup tape. Can someone help me what command I will use... (0 Replies)
Discussion started by: ayhanne
0 Replies

2. Shell Programming and Scripting

Files with 0 file size and created today

hi, I am building a script to identify those files created/modified today and with file size 0. I am able to find the files with 0 file size and created/modified in last 24 hrs as shown below but not today (current date), I tried using (touch -t time filenm) but in my version of unix at work it... (7 Replies)
Discussion started by: rushs682
7 Replies

3. UNIX for Advanced & Expert Users

backup a file and keep every version of the backup

I am trying to backup my .bash_history and I want to keep every version of the backup. I am thinking to put one of these in my crontab. 0 0 * * 0,3 cat .bash_history > boo 0 0 * * 0,3 cp .bash_history boo I would like the backups to be called boo1, boo2, boo3, etc. I would like to keep... (7 Replies)
Discussion started by: cokedude
7 Replies

4. Shell Programming and Scripting

check file exists and created today issue

Morning My other issue I have seems very simple but im just not seeing it. I have a script that checks on a remote share to see if the backups for some systems have run. Its as simple as: find /mnt/ukwcs-net-config/WLAN-Controllers/ -mtime -1 -ls | egrep '(cfg)' > wlanlog.txt cut -c 1-92... (4 Replies)
Discussion started by: ltodd2
4 Replies

5. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

6. Shell Programming and Scripting

getting timestamp of a file and if it was accessed today then finding a line in it

i have my files and the variables value extracted from db is taken as in1=slot0312 in2=best in3=it is :veryliong/fine as varibles.. i have a folder stuctures in my unix machine as : /2011/hand_sl0312/best/HOD/file1.txt /2011/hand_sl0312/happy/HOD/file1.txt... (1 Reply)
Discussion started by: rajniman
1 Replies

7. Shell Programming and Scripting

meaning of today=${1:-${today}}

what does today=${1:-${today}} mean??? I saw a script which has these two lines: today=`date '+%y%m%d'` today=${1:-${today}} but both gives the same value for $today user:/export/home/user>today=`date '+%y%m%d'` user:/export/home/user>echo $today 120326... (2 Replies)
Discussion started by: Vidhyaprakash
2 Replies

8. UNIX for Advanced & Expert Users

Script to rename file that was generated today and which starts with date

hello, can someone please suggest a script to rename a file that was generated today and filename that being generated daily starts with date, its a xml file. here is example. # find . -type f -mtime -1 ./20130529_4995733057260357019.xml # this finename should be renamed to this format.... (6 Replies)
Discussion started by: bobby320
6 Replies

9. Shell Programming and Scripting

Help Needed for creating the folder by checking today's date and, take backup using rsync command

How to create a shell script to create a folder by using the today's date to take backup using rsync command on every evening around 7 pm. Kindly help. Thanks. To be more precise, I want to create a script which matches the today's date with server's date format, if matches then creates the... (2 Replies)
Discussion started by: bakula10
2 Replies

10. UNIX for Beginners Questions & Answers

Find and copy .zip file based on today's date

Hi Team, I'm new to unix and i have a requirement to copy or move files from one directory to another based on current date mentioned in the .zip file name. Note that i need to copy only the recent zip file. please help me with the code i tried the code as: #! /usr/bin/sh find... (3 Replies)
Discussion started by: midhun3108
3 Replies
DBM(3X) 																   DBM(3X)

NAME
dbminit, fetch, store, delete, firstkey, nextkey - data base subroutines SYNOPSIS
#include <dbm.h> typedef struct { char *dptr; int dsize; } datum; dbminit(file) char *file; datum fetch(key) datum key; store(key, content) datum key, content; delete(key) datum key; datum firstkey() datum nextkey(key) datum key; DESCRIPTION
Note: the dbm library has been superceded by ndbm(3), and is now implemented using ndbm. These functions maintain key/content pairs in a data base. The functions will handle very large (a billion blocks) databases and will access a keyed item in one or two file system accesses. The functions are obtained with the loader option -ldbm. Keys and contents are described by the datum typedef. A datum specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal ASCII strings, are allowed. The data base is stored in two files. One file is a directory containing a bit map and has `.dir' as its suffix. The second file contains all data and has `.pag' as its suffix. Before a database can be accessed, it must be opened by dbminit. At the time of this call, the files file.dir and file.pag must exist. (An empty database is created by creating zero-length `.dir' and `.pag' files.) Once open, the data stored under a key is accessed by fetch and data is placed under a key by store. A key (and its associated contents) is deleted by delete. A linear pass through all keys in a database may be made, in an (apparently) random order, by use of firstkey and nextkey. Firstkey will return the first key in the database. With any key nextkey will return the next key in the database. This code will traverse the data base: for (key = firstkey(); key.dptr != NULL; key = nextkey(key)) DIAGNOSTICS
All functions that return an int indicate errors with negative values. A zero return indicates ok. Routines that return a datum indicate errors with a null(0) dptr. SEE ALSO
ndbm(3) BUGS
The `.pag' file will contain holes so that its apparent size is about four times its actual content. Older UNIX systems may create real file blocks for these holes when touched. These files cannot be copied by normal means (cp, cat, tp, tar, ar) without filling in the holes. Dptr pointers returned by these subroutines point into static storage that is changed by subsequent calls. The sum of the sizes of a key/content pair must not exceed the internal block size (currently 1024 bytes). Moreover all key/content pairs that hash together must fit on a single block. Store will return an error in the event that a disk block fills with inseparable data. Delete does not physically reclaim file space, although it does make it available for reuse. The order of keys presented by firstkey and nextkey depends on a hashing function, not on anything interesting. 4th Berkeley Distribution May 12, 1986 DBM(3X)
All times are GMT -4. The time now is 05:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy