Programming :: How To Get Same Script To Remove Weeks 2-5

Oct 11, 2010

I need to write a script which will delete all the previous directories I have created. I have found out how to remove one directory with the following code:find /media/CE40-EB9D -type d -name "week1" -exec rm -rf {} ;but how can I get the same script to remove weeks 2-5?

View 5 Replies


ADVERTISEMENT

Ubuntu :: CLI Backup With Deletion After 2 Weeks?

May 11, 2010

I'm currently using rsync to backup one drive to another. However, it is not currently set up to delete files if they are deleted from the source directory. I'm looking for a way to tell it to delete a file if it was deleted form the source directory X number of days ago.

Anyway I can do this with rsync or a combo with another backup program?

View 1 Replies View Related

Fedora :: Kickstart Has Been Broken For Two Weeks?

Oct 7, 2010

Here's the error I'm getting:

Code:
Package xine-lib-pulseaudio is obsoleted by xine-lib, trying to install xine-lib-1.1.18.1-1.fc12.i686 instead
error: not an rpm package
umount: /var/tmp/imgcreate-k0CsZq/install_root/var/cache/yum: device is busy.
(In some cases useful info about processes that use

[Code].....

View 5 Replies View Related

Server :: System Crash Every 3 Weeks?

Jan 6, 2011

"system crash" means that:(1)I can ping it , but can not connect to it (via ssh or http or anything else)(2)the major role of that machine is to run a web application written in java, every 3 weeks(almost that), the users inform us and say they can log in that web application , and we find the situation just like (1) says.When this happen , we can only restart the machine by pushing the power button.(It's sad !)I've try to read all the log files located in /var/log but find nothing interesting.

View 5 Replies View Related

Fedora :: Avasys Pipslite Broken In Last Two Weeks?

Feb 20, 2010

I use the Avasys pipslite driver for my Epson TX210 printer on Fedora FC12. It worked fine two weeks ago, but now only prints a solid black square for the print area. The printer is fine, as it prints normally under Windows. I rebuilt the driver from source.

View 3 Replies View Related

Software :: Crontab Entries Running On Even And Odd Weeks

Sep 24, 2010

I'm using crontab to start and stop music playback (its like start and end of a brake in school). The problem is that some of the entries should be run on even weeks and some on odd.
exp:

This should be played on even weeks
00 08 * * * audacious -p
10 08 * * * audacious -u
and this on odd
05 08 * * * audacious -p
15 08 * * * audacious -u

There are about 20 entries for even and 20 for odd. I found here on the forum that maybe this should work but for it is not working for me
00 08 * * * [[ $(expr `date +\%W` \% 2) = 0 ]] && audacious -p
If I put it like that its not working at all

View 7 Replies View Related

Ubuntu :: Performance Degradation After 3 Weeks Up Time

Oct 17, 2010

I have noticed that after 20 days of system up time, the ubuntu is not as fast as the first day.maybe the RAM is polluted with necessary files or there are some unnecessary disk activities.

View 2 Replies View Related

Ubuntu Installation :: Upgrades Held Back For Weeks ?

Jan 29, 2010

On my 8.04 server installation, I've been getting this message from apt-get upgrade for a few weeks:

Code:

I thought this would be fixed with the 8.04.4 release yesterday, but alas, it was not so.

It's bugging me a bit that there are packages that need to be upgraded, but it's not doing it.

View 5 Replies View Related

Programming :: How To Remove Last Two Fields

Apr 27, 2010

I have a filename file-name-here-1.2.3-i486-2.tar I would like to know how to remove the last two fields leaving only: file-name-here-1.2.3

I can use:

x=file-name-here-1.2.3-i486-2.tar
echo ${a%-*}

to remove the last field (after -) but how do i remove the last two in one fell swoop?

View 2 Replies View Related

Programming :: How To Remove The Last Character

Jun 27, 2010

I have a string like this "/home/test/filename.txt" and i want to delete all character after the last "/". how to do that using sed or awk.

View 5 Replies View Related

Programming :: Remove All Lines Containing 'A,,,,,,?

Nov 3, 2010

How can I remove all lines which contain A,,,,,, I tried the following sed statements but no luck.

Code:

sed "/A,,,,,,/d file"
sed "/A,,,,,,/d file"

View 6 Replies View Related

Programming :: Remove First And Last Character?

Feb 24, 2010

which is the simplest way to have first and last character cropped out from a string? Something simpler than

Code:

echo $STRING | cut -b 2- | rev | cut -b 2- | rev

View 6 Replies View Related

Programming :: Gc-sections Remove All Function Not Used?

Nov 18, 2010

This is my file, named xxx.c. And there are two functions in it.

[code]...

When I try to compile the whole project, I used -ffunction-sections,-fdata-sections to generate the .o files, use Wl,--gc-sections -Wl,--print-gc-sections to link to the exacutable file. gcc 4.3.2 ld 2.18 Debian 5 After the first time I compiled it, I got a list of Removed functions. But one second later, I rememberd that I forget to close the Compile Switch: Debug. Then I had to recompile it and got another list. Compare these two lists, I found that , bxx isn't on the second list. First I guess that bxx is a debug function but never used in debug mode, and it won't be compiled in release mode. I check the source and find that there was no compile switch for bxx. But it's caller function axx, is removed, both the debug switch is on and off. I try to compiled the project for several times , but the result is the same. I can't realized it , why? Is that the --gc-sections won't remove all the functions not used?

View 4 Replies View Related

Programming :: Remove All Files From A Directory Which Are 24 Hr Old?

Apr 8, 2010

I was preparing a script which will remove all my files from directory which are 24 hour old.I tried some thing like thisfind . ( -name 'log.*' -mtime +1 ) -exec rm {}; but it is throughing error like : missing argument to exec.

View 8 Replies View Related

Programming :: Mod_rewrite Remove Sub-directories From URL?

Apr 25, 2011

I have tried this a million ways, got it to work once but it didn't work sitewide for some reason. I have a url: [URL] and I want it to be found by going to: [URL] I am using this

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^([^/]+)/?$ agents/tp/$1/index.php [L]

and have also tried something as basic as

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^(.*)$ agents/tp/$1/index.php [L]

I keep getting "The requested URL /JoeAgent/ was not found on this server." why it's not working?

View 4 Replies View Related

Programming :: How To Remove Un-wanted Text?

Dec 16, 2010

I am trying to parse some information from a webpage and store the output into an array. Basically i have found using HTML::TokeParser to be useful at stripping out all the html tags, i have one problem with the output though there is 2 occurances of the same "item" within the output.

View 1 Replies View Related

Programming :: Remove Characters From Within Variable

Feb 20, 2011

I am doing a mysql query with a bash shell script like:
mysql translator -u root --password=******** -e "SELECT word FROM tagalog ORDER BY RAND() LIMIT 1" | while read line; do
echo $line

So when I echo the value of $line I get:
word
magandang umaga
"word" is the name of the row in the table and maganda umaga is a randomly selected choice from the row. Is there a way i can remove the name of the row from the variable $line. With a result that will allow me to echo $line and output only the randomly selected entry in from the row e.g. magandang umaga

View 13 Replies View Related

Programming :: Remove Duplicate Entries On A Row?

Nov 1, 2010

we have a variable LIBS:

LIBS='-lpq -lmysqlclient -lssl -lpthread -lresolv -lssl -lpthread -lresolv'

I'd want to get:

LIBS='-lpq -lmysqlclient -lssl -lpthread -lresolv'

Bear in mind that LIBS can be variable, I mean I need to drop any duplicate and only retain the last one of each different entry. And we must keep the order as is, I must not sort out them.

So, if LIBS is:

LIBS='-lpq -lmysqlclient -lpthread -lresolv -lpthread -lresolv'

I need: LIBS='-lpq -lmysqlclient -lpthread -lresolv'

View 3 Replies View Related

Programming :: Remove Everything From Starting Until Some Keyword?

Mar 24, 2011

I have a multiple txt file in one folder. I would like to remove everything from starting until find string keyword in one folder. Here is the sample of my text:

Code:

5a651a62sf1a54f2a1sf6a4f50a5f4a2f1a2d1sfs11231211f61d021sd1fs1Reassembles21f2sdf122dfs21fs212sdfdsf1s65f1s62f1

So i want to remove everything from starting until reassemble. Here is the sample output:

Code:

s21f2sdf122dfs21fs212sdfdsf1s65f1s62f1

I have multiple file in one folder. So how to use any script to read in one directory folder and do a same task. I prefer using awk, sed or perl.

View 5 Replies View Related

Programming :: Remove The Last Character From Variable

Jun 22, 2010

i have the following:

Quote:

echo %host%|sed "$s/.$//"

this would remove the Last character of the value assigned to the %host%. for example if my value is: abcd i get abc. but i am not able to assign the output. for example when i do

Quote:

set k=`echo %host%|sed "$s/.$//"`

after doing echo %k i get no output at the command prompt...!! whereas when i just type:

Quote:

echo abcd|sed "$s/.$//"

at the command prompt i get abc. maybe some other ways to Remove the Last character...?

View 13 Replies View Related

Programming :: Remove White Space, +, And -, By Awk

May 18, 2011

I have some data whose no certain pattern. Below is as an example.

20110101 1+1-0 1-1 1+1-2 8- 5 3 0 3 4 5 3 7 4
20110102 1+2-0+1-1-1+2-1+ 9 5 6 2 3 3 5 6 5 4
20110103 1-1-0+1 1 2 2 2+10 3 3 2 4 4 7 7 9 5
20110104 1+3-1 1 1+2-2-1-11+ 5 12 4 4 5 6 6 3 6
20110105 0 0 0 1-1-1-1+1 4+ 0 0 0 3 3 3 5 4 2
20110106 1+0+0 0+0+1 2 4+10- 5 2 0 2 2 4 7 32 7

I want to remove space, + and - mark so that I can get the below such data :

20110101 1 1 0 1 1 1 1 2 8 5 3 0 3 4 5 3 7 4
20110102 1 2 0 1 1 1 2 1 9 5 6 2 3 3 5 6 5 4
20110103 1 1 0 1 1 2 2 2 10 3 3 2 4 4 7 7 9 5
20110104 1 3 1 1 1 2 2 1 11 5 12 4 4 5 6 6 3 6
20110105 0 0 0 1 1 1 1 1 4 0 0 0 3 3 3 5 4 2
20110106 1 0 0 0 0 1 2 4 10 5 2 0 2 2 4 7 32 7

Is it possible by using awk?

View 7 Replies View Related

Programming :: Using Eval To Remove Backslashes?

Jun 21, 2010

I am using bash. My question is :

Code:
eval echo \h
eval echo \h
both give output as h, but
Code:
eval echo \\h
gives output as h Why ?

Does eval here just remove backslashes (I know the use of eval in the case where substitutions occur)

View 1 Replies View Related

Programming :: Using Sed To Remove All But The Last 17 Characters On A Line?

Jun 3, 2010

I'm having a bit of a headbanger trying to work this one out. I'm trying to remove all of the characters on a line apart from the last 17. For example, I need to change this:

Code:

00000000000000000089;0bbfaeb8
01000000000000000089;0bcb5948
00000000000000000089;0bcc4c40

[code]....

View 5 Replies View Related

Programming :: Bash - Remove From Text Table?

Nov 7, 2010

i have a table in a text file. How can i remove from that table for example "SLS= " if the value is empty? Is it possible to do it in bash awk or sed? [URL]

10.25 SLS=* G.V.=* BBU=122 G.V.=14
10.28 SLS=196 G.V.=198 BBU=* G.V.=*
10.08 U.T.=* I.M=--
10.15 U.T.=-0.522 I.M=*

View 1 Replies View Related

Programming :: How To Remove Alternate Char From File

Jan 19, 2010

How to remove alternate char from file using shell script? If the file content is "1234567890" the output file should be "24680".
sed 's/(.)(.)/2/g' filename
Now there may be small modification to generate two alternate byte, what it should be? If the file content is "1234567890" the output file should be "125689".

View 4 Replies View Related

Programming :: Using Sed To Remove Preceding And Trailing Spaces In CSV?

Sep 16, 2010

the preceding and trailing spaces around the commas in my CSV without destroying my address field. I'm new to regex and sed so this is probably easy but I just can't do it without destroying the Address section. I'm using vanilla Linux and sed 4.1.3I'm willing to use any regex or even awk if needed.

Example:
I need this
randall , dean, 11111 , 1309 Hillside Ave., Warsaw, VA , 23591

[code]....

View 11 Replies View Related

Programming :: Remove All Lines Containing Extended Characters

Nov 7, 2010

I am using 'sed -e /foo/d' to match lines which I want to delete from a file. I discovered I have some lines which contain random (extended?) characters like 'ủ' which I would also like to delete. The lines in the file should only contain alpha numeric characters.

View 8 Replies View Related

Programming :: Remove Alpha Channel From Bitmaps?

Dec 31, 2010

Is there anyway i can remove alpha channel from bitmaps without messing them up?

View 8 Replies View Related

Programming :: Remove Characters From Grep Output?

Apr 14, 2010

How can I remove characters from grep output using sed? code...

View 9 Replies View Related

Programming :: Remove Double Quotes Bash?

Jul 20, 2011

grep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#" | awk '{print $3}'

output = "gb"
sometimes= "us"

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved