Search Results

Search: Posts Made By: prometheon123
Forum: OS X (Apple) 05-02-2013
6,552
Posted By prometheon123
Remove leading spaces from file names and folders
Hi All,

I have a vexing issue with leading spaces in file names. Basically, we're moving tons of data from our ancient afp file share to Box.com and Box forbids leading spaces in files or...
25,717
Posted By prometheon123
Is that in both lines? I tried it in both and it...
Is that in both lines? I tried it in both and it didn't work.


#!/bin/bash

# Find all files or folders containing 'bad' characters.
find . -depth -name "*[^a-zA-Z0-9._- ]*" |
# Read them...
25,717
Posted By prometheon123
Awesome! [^a-zA-Z0-9._-] worked terrific. If...
Awesome! [^a-zA-Z0-9._-] worked terrific. If it's ok to leave the spaces in the name, what would I add or subtract out of that line to make it happen.

Thank you both again for your help!
25,717
Posted By prometheon123
Sorry about missing the brackets. This is why I...
Sorry about missing the brackets. This is why I can never be a coder.

I'm finally getting somewhere though!


When I ran the script, it seems like it's replacing more than I want it to. For...
25,717
Posted By prometheon123
I think I understand. So both lines, should look...
I think I understand. So both lines, should look like:
find . -depth -name "*\/*?”<>|*" |
and
NEWFILE="${FILE//[\/*?”<>|]/_}"

Did I get that right?

Then I should run sh renamefiles.sh...
25,717
Posted By prometheon123
This shell script looks awesome. Just what I was...
This shell script looks awesome. Just what I was looking for. Thanks again.

So if I wanted to only replace these characters: \/*?”<>| which line would I define that in?
25,717
Posted By prometheon123
Hey Otheus, Thanks for the response and the...
Hey Otheus,

Thanks for the response and the help. I'm able to get your script working for some reason. Don't I need to specifically specify perl in the command line? A script I found that seems...
25,717
Posted By prometheon123
How best to remove certain characters from filenames and folders recursively
hello,

I'm trying to figure out which tool is best for recursively renaming and files or folders using the characters \/*?”<>| in their name. I've tried many examples that use Bash, Python and...
4,515
Posted By prometheon123
And this can be run without user interaction? ...
And this can be run without user interaction? Basically, and I apologize for not making it very clear before, is that the idea is for me to run this shell script with out the user's interaction. ...
4,515
Posted By prometheon123
So I would do a #!/usr/bin/bash echo -n...
So I would do a
#!/usr/bin/bash
echo -n "Enter the number 1 to install then press [ENTER]: "
read INSTALL

if [ $INSTALL = 1 ]
then
echo "install"
else
echo "not install"
sh...
4,515
Posted By prometheon123
Use expect to run an interactive shell script?
Hi all,

I have a bit of a vexing issue here and I'm not certain how best to go about it. Basically, I want to run a shell script and automate the user prompt of hitting 1 to fully uninstall...
18,183
Posted By prometheon123
Thanks none-the-less. I really appreciate...
Thanks none-the-less. I really appreciate everyone's help!
18,183
Posted By prometheon123
That did it. So now I've got: if [ `ps aux |...
That did it. So now I've got:

if [ `ps aux | grep java | sort -r -k4 | head -1 | awk '{print int($4)}'` -gt 80 ];then
/usr/local/webhelpdesk/whd restart
fi

exit 0

Thanks!
18,183
Posted By prometheon123
I'm running CentOS release 5.8 (Final) The...
I'm running CentOS release 5.8 (Final)

The ps aux | grep java | sort -r -k4 | head -1 | awk '{print $4}' command does list the amount of memory Java is using. When I run that command it's listed...
18,183
Posted By prometheon123
Didn't seem to work. Restarted the daemon...
Didn't seem to work. Restarted the daemon regardless of memory usage. Didn't see any output as to why.

Here's what I put in shell script:

#!/bin/sh

# Restart WHD if memory usage hits 80%...
18,183
Posted By prometheon123
Thanks so much. I'll definitely give that a try.
Thanks so much. I'll definitely give that a try.
18,183
Posted By prometheon123
It's really java that is causing the Nagios...
It's really java that is causing the Nagios alerts. Java eventually creeps up to 100% of it's allotted utilization.

***** Nagios *****

Notification Type: PROBLEM

Memory WARNING - 82.9%...
18,183
Posted By prometheon123
Wow, this looks great. Thanks so much! In...
Wow, this looks great. Thanks so much!

In the != "", can I assume that I enter !="java"? java is actually the name of the process that's taking up 80% or more of memory.
18,183
Posted By prometheon123
Wish I could, however, the application in...
Wish I could, however, the application in question, Web Help Desk, is a memory hog.

---------- Post updated at 04:28 PM ---------- Previous update was at 04:28 PM ----------

I'm using CentOS 5.8
18,183
Posted By prometheon123
Cron job and shell script to kill a process if memory gets to high
Hello,

I'd like to set a cron job that runs a shell script every 30 minutes or so to restart a java based service if the memory gets above 80%. Any advice on how to do this?

Thanks in advance!...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 04:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy