Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to tar an extension from a certain directory? Post 303043822 by mcesmcsc on Friday 7th of February 2020 02:47:35 PM
Old 02-07-2020
So can I keep the original command for creating the tar and use the “cd” for the extraction? The problem with using full path is it is homework and when tested by instructor it is run in his environment and and not sure if they have same directories. May be home/instructor and not home/student...
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Feedback: Allow tar.gz extension for files

Hi, ich just uploaded a file to the forum and found that the tar.gz extension for files is not allowed... i renamend the file to *.zip but tar.gz is a common format in the unix world. is it possible to change that? tia, DN2 (2 Replies)
Discussion started by: DukeNuke2
2 Replies

2. Shell Programming and Scripting

compress directories with .tar extension

hi guys.. Since am a bit new to shell scripting, can anyone help me with this problem please.. i've been struggling with it since 2 days. :( I have a directory lets say myFolder and within it I have sub directories let say myFolder1.tar, myFolder2, myFolder3, etc. I need to write a shell... (12 Replies)
Discussion started by: kanexxx
12 Replies

3. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

4. Shell Programming and Scripting

copy files with new extension in same directory

I've been able to find all the extensionless files named photos using the command: find /usr/local/apache/htdocs -name photos -print0 I need to copy those files to the name photos.php in their same directory. I've found a bunch of xarg examples for moving to other directories but I wasn't... (7 Replies)
Discussion started by: dheian
7 Replies

5. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

6. UNIX for Dummies Questions & Answers

Copy files with same name but different extension from 2 different directory

Hi all, i have 2 directory of files, the first directory(ext1directory) contain files of extension .ext1 and the second directory(allextdirectory) contains files of multiple extensions (.ext1,.ext2,.ext3,..) so i want to copy the files from directory 2(allextdirectory) that have the same name... (8 Replies)
Discussion started by: shelladdict
8 Replies

7. Shell Programming and Scripting

Bash command line to strip tar.gz file extension?

What's the command syntax for stripping out the tar.gz file extension in a bash command line (not script file). Thanks! prompt/> ls *.tar.gz | <what comes here?> (3 Replies)
Discussion started by: ZillaG
3 Replies

8. Shell Programming and Scripting

Check for file with a particular extension in a particular directory

Hi, I have a directory which I am passing in my script as a parameter. Parameter name has been set to $TCH_FILE_DIRECTORY. I want to know if there's atleast 1 (or more) files in this directory with the extension '.tch'. How can I find this using ksh. (4 Replies)
Discussion started by: Bhavesh Sharma
4 Replies

9. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

10. UNIX for Beginners Questions & Answers

Find file with extension and excluding directory

Hi, I have an inquiry on how do I use the find command in Solaris Unix to find some file ends with extension : txt, err in the root directory with modified date of 30days and this find command will also need to exclude b directory and its subdirectory. All the files from the above find criteria... (5 Replies)
Discussion started by: snowfrost88
5 Replies
DB5.1_HOTBACKUP(1)					      General Commands Manual						DB5.1_HOTBACKUP(1)

NAME
db5.1_hotbackup - Create "hot backup" or "hot failover" snapshots SYNOPSIS
db5.1_hotbackup [-cDuVv] [-d data_dir ...] [-h home] [-l log_dir] [-P password] -b backup_dir DESCRIPTION
The db5.1_hotbackup utility creates "hot backup" or "hot failover" snapshots of Berkeley DB database environments. The db5.1_hotbackup utility performs the following steps: 1. If the -c option is specified, checkpoint the source home database environment, and remove any unnecessary log files. 2. If the target directory for the backup does not exist, it is created with mode read-write-execute for the owner. If the target directory for the backup does exist and the -u option was specified, all log files in the target directory are removed; if the -u option was not specified, all files in the target directory are removed. 3. If the -u option was not specified, copy application-specific files found in the database environment home directory, or any directory specified using the -d option, into the target directory for the backup. 4. Copy all log files found in the directory specified by the -l option (or in the database environment home directory, if no -l option was specified), into the target directory for the backup. 5. Perform catastrophic recovery on the hot backup. 6. Remove any unnecessary log files from the hot backup. The db5.1_hotbackup utility does not resolve pending transactions that are in the prepared state. Applications that use DB_TXN->prepare should specify DB_RECOVER_FATAL when opening the environment, and run DB_ENV->txn_recover to resolve any pending transactions, when failing over to the hot backup. OPTIONS
-b Specify the target directory for the backup. -c Before performing the snapshot, checkpoint the source database environment and remove any log files that are no longer required in that environment. To avoid making catastrophic failure impossible, log file removal must be integrated with log file archival. -d Specify one or more source directories that contain databases; if none is specified, the database environment home directory will be searched for database files. As database files are copied into a single backup directory, files named the same, stored in different source directories, could overwrite each other when copied into the backup directory. -h Specify the source directory for the backup, that is, the database environment home directory. -l Specify a source directory that contains log files; if none is specified, the database environment home directory will be searched for log files. -P Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments. -u Update a pre-existing hot backup snapshot by copying in new log files. If the -u option is specified, no databases will be copied into the target directory. -V Write the library version number to the standard output, and exit. -v Run in verbose mode, listing operations as they are done. -D Use the data directories listed in the DB_CONFIG configuration file in the source directory. This option has three effects: First, if they do not already exist, the specified data directories will be created relative to the target directory (with mode read-write- execute owner). Second, all files in the source data directories will be copied to the target data directories. If the DB_CONFIG file specifies one or more absolute pathnames, files in those source directories will be copied to the top-level target directory. Third, the DB_CONFIG configuration file will be copied from the +source directory to the target directory, and subsequently used for configuration if recovery is run in the target directory. Care should be taken with the -D option and data directories which are named relative to the source directory but are not subdirectories (that is, the name includes the element "..") Specifically, the constructed target directory names must be meaningful and distinct from the source directory names, otherwise running recovery in the target directory might corrupt the source data files. It is an error to use absolute pathnames for data directories or the log directory in this mode, as the DB_CONFIG configuration file copied into the target directory would then point at the source directories and running recovery would corrupt the source data files. The db5.1_hotbackup utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db5.1_hotbackup should always be given the chance to detach from the environment and exit gracefully. To cause db5.1_hot- backup to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT). The db5.1_hotbackup utility exits 0 on success, and >0 if an error occurs. ENVIRONMENT
DB_HOME If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DB_ENV->open. AUTHORS
Oracle Corporation. This manual page was created based on the HTML documentation for db_hotbackup from Sleepycat, by Thijs Kinkhorst <thijs@kinkhorst.com>, for the Debian system (but may be used by others). 28 January 2005 DB5.1_HOTBACKUP(1)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy