All Questions
19 questions
1
vote
0
answers
85
views
gtar recursively untar but leave in top directory
I am trying to recursively untar a whole lot of directories that have .tar files in them, but without creating any new subdirectories.
I am successfully able to do one at a time with this command
gtar ...
0
votes
1
answer
655
views
extract tar then enter its directory (shell scripting)
How do I make script exctract tar then enter the extracted tar directory?
I was trying
xtract
#!/bin/bash
tar -xvf $1 && cd $1
Usage example
suppose there's foo.tar.xz
so how to use it: ./...
0
votes
1
answer
224
views
gzip, send to server, ungzip
I am working on a script to backup and gzip a set of MySQL tables, scp/ssh them to a different server and then unpack them
current script is:
#!/bin/bash
DATE=`date +"%d_%b_%Y_%H%M"`
...
0
votes
1
answer
126
views
Create TAR files with limited size in Unix script [duplicate]
printf 'n Log-%02d.tar\n' {2..}|tar cf /var/opt/sw/e4/data/dev/e4_dev/DEVL3/EW/EWD1/DATA/AED/OUTPUT/Log-01.tar -ML1900m /var/opt/sw/e4/data/dev/e4_dev/DEVL3/EW/EWD1/DATA/AED/Temp
I tried to use the ...
0
votes
2
answers
2k
views
TAR 6 GB worth of files into separate 1.9 GB TAR files [duplicate]
I have 28,000 files of size 6.7 GB in the directory aaa/input.
I need create TAR files in the directory aaa/output, such that each TAR file cannot exceed 1.9 GB, so I have to tar the 28,000 files into ...
0
votes
1
answer
545
views
How to compress every file in a directory into its own compressed file (files not in current directory)
If the location DATA/AAA/INPUT contains n files (the file names are random job names), I need to create tar files for all the n files in the DATA/AAA/OUTPUT location with a common name format.
So, if ...
1
vote
2
answers
5k
views
Checking if tar file exists | bash script
I am trying to test if the tar file I am about to create already exists. If it doesn't then I want to create the tar file (this part of the code works). However the if statement testing if that file ...
1
vote
1
answer
871
views
Script "7 days log tar and then remove the 7 days logs and exclude the tar file after next 7 days"
I am trying to create a script such that it could tar.gz all the previous log of per 7 days log and exclude the tar file in next run.
Is the script ok or should I have to make a change
find /home/...
4
votes
4
answers
5k
views
Keep only a certain amount of backups (tarballs) in a directory
On my debian 9.4 machine I have a script that automatically compresses & backups up all my files in a srv/ with the date in the name xx-xx-xxxx.tar. It is moved to my backups/ directory.
I would ...
1
vote
2
answers
2k
views
Tar directory into archive with the same name as the directory?
Is there an elegant one-liner to tar/archive the whole directory and delete it afterwards? So far I came up with bulky solutions.
from:
# ls -la
drwxr-xr-x 3 root root 4096 Jul 4 15:01 .
drwxr-xr-x ...
6
votes
3
answers
14k
views
Delete everything before last slash in bash variable
I have a variable myVar in bash containing a long string that looks like this:
-rw-rw-rw- root/root 16 2018-02-12 10:03 foo_tar/baz1234_
I want to delete everything in myVar before the last slash (...
0
votes
1
answer
1k
views
Bash script to tar – Quoting issue [duplicate]
I have a script that takes filenames as positional parameters. I perform a few operations on these and then tar them. Currently my script is not working. The echo line is there for debugging ...
0
votes
3
answers
3k
views
UNIX Shell Script Backup Directory on Specific day
Basically this is the question im trying to answer
2) Write a shell script (fridaybackup.sh) which will, if run on Friday, backup all files in user2 home directory. The script will create a backup (...
0
votes
2
answers
6k
views
Script to Tar file in a specific Directory
I'm trying to write a Unix script that will go to a specific directory and tar.gz all the log files that are older than 2 days. So far I have this but it doesn't work. Any help would be appreciated.
...
1
vote
3
answers
5k
views
Bash script for automatic tar backup of chosen files and directories
Within a given directory in linux environment, I need to pick all files modified after a certain date (let's say 7 days) as well as all directories (only in root directory, hence non recursively) ...