Sponsored Content
Top Forums Programming Cant remove directory on bash script Post 302994580 by RudiC on Friday 24th of March 2017 02:19:06 PM
Old 03-24-2017
First: screen shots don't help way as much as do execution logs posted in text form, e.g. created by setting the shell's -x (xtrace) option. The latter can be analysed line by line, whereas your screen shot doesn't allow for almost anything...
Second: if you exit anyway after an error has occurred, why not use the shell's -e (exit on non-zero status) and trap builtin?

Where exactly is the script stuck? With all the confusing directory definitions and cding, I can't see a file removal in robert_test as "$temp"/"$base" should translate to /mnt/robert_test/temp/testdirtobearchived
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to remove all empty files within the directory structure?

Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted. I've be... (5 Replies)
Discussion started by: cat123
5 Replies

2. Shell Programming and Scripting

remove directory x seconds after script completes

Hi guys, I am working with a script within a Mac OS X package installer. The package installer will run the bash script once the files have been copied/installed. I have a little trouble with the last line of my script causing the package installer to crash once in a while and I have narrowed it... (1 Reply)
Discussion started by: tret
1 Replies

3. Shell Programming and Scripting

Remove shell script and its directory

Hi, I have shell script which is located in /opt/Test/test.sh code in test.sh is as follows #!/bin/sh rm -rf /opt/Test exit 0 when I tried to execute the above script from its location, it shows the following error rm: Cannot remove any directory in the path of the... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies

4. Shell Programming and Scripting

How to get rid of cannot remove file error in bash script?

Hi Guys, I am creating a couple of temp. files in a script. After completing the script, I am using the rm command to delete these files. The files are getting deleted but I am getting "filename - cannot find file;no such file or directory" error in my bash shell terminal window. I am using... (3 Replies)
Discussion started by: npatwardhan
3 Replies

5. Shell Programming and Scripting

An Issue with the script which used to remove a file from the current directory.

Hello forum members, I am writing a script to two tasks. 1: displaying the list of the files in the current directory. 2: removing the specifed file from the list. I have written a sample script ,so can u please verfiy and correct. echo Enter list of files ls *.txt read textfile rm -f... (3 Replies)
Discussion started by: sivaranga001
3 Replies

6. Shell Programming and Scripting

bash script directory size

hello! i need to make a script that get a folder name in parameter and i get back the size of the folder include the subfolders! but i dont know how i need to start :S Example: a folder contain the followings a: drwxr-xr-x 2 user user 4096 febr 25 08.27 b -rw-r--r-- 1 user user 2 febr... (3 Replies)
Discussion started by: impish
3 Replies

7. Shell Programming and Scripting

shell to script to remove directory

Hello All I want to delete the directory in my tree structure . all the filenames like this dd-mm-yyyy Example 30-01-2011 31-01-2011 01-02-2011 I want to grep the latest last four days created directorey by not using the find command . how do i do that ? (1 Reply)
Discussion started by: kvk_shell
1 Replies

8. Shell Programming and Scripting

How to remove comments from a bash script?

I would like to remove comments from a bash script. In addition, I would like to remove lines that consist of only white spaces, and to remove blank lines. #!/bin/bash perl -pe 's/ *#.*$//g' $1 | grep -v ^]*$ | perl -pe 's/ +/ /g' > $2 # # $1 INFILE # $2 OUTFILE The above code... (10 Replies)
Discussion started by: LessNux
10 Replies

9. UNIX for Dummies Questions & Answers

Script to remove zip files from a directory

Hi Folks, There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Discussion started by: punpun66
1 Replies

10. Shell Programming and Scripting

Remove original file from directory after bash executes

The below bash works great, except I can not seem to delete the original file $f from the directory. Thank you :) For example, after the bash executes there are 8 files in the directory: 123.txt (original file) 123_remove.txt 123_index.txt 123_final.txt 456.txt (original file)... (11 Replies)
Discussion started by: cmccabe
11 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy