Server :: Using Locate With Rm - Doesn't Work When Pathnames Occasionally Contain Spaces
Mar 2, 2011
does anyone know how can I use locate with rm? rm `locate "some file"` does not work when my pathnames occasionally contain:
-spaces and other characters (like + or possibly others that need escaping)
-greek characters
how can I grab line-by-line the output from locate and wrap quotes"" around the paths?
View 5 Replies
ADVERTISEMENT
Apr 13, 2011
I have a fresh dedicated server that im currently configuring and needed a little help if I may ask.The problem is that i'm having a file naming issue. for example from the web I can access any file that does not have spaces of any type. ex/music/musicfile.mp3this works fine and my php script can locate itBut the problem is when I try to access a file that has spaces.ex/music/The Eagles - Hotel California.mp3my php script can't seem to locate any files like this with spaces but doesn't have a problem locating the files with no spaces.
I also took a look at the directory within shell. I did notice that files that have spaces are showing up in this formatt in shell.#/home/~username/public_html/music/The Eagles - Hotel California.mp3In shell , i'm assuming that unix/linux maybe adds a backslash before spaces. But when I FTP to this same directoy, the filename look normal and at windows standard. how could I correctly access these types of files within my php scrits? or would I need to have all uploaded files renamed so that spaces are replaced with underscores maybe?
View 4 Replies
View Related
Nov 27, 2010
I have a file of the type:
a = b
where a is any string and b is an integer The 'a' string doesn't have any spaces in it.
Everything was running fine till I was searching for 'a' and finding value 'b' by expression
Code:
string="$a"
egrep -i -m1 "^[[:space:]]$string[[:space:]]*=" | awk -F'=' 'gsub(/^[[:space:]]+/,"",$2)gsub(/[[:space:]]+$/,"",$2){print $2}'
I recently ran into a situation where in the string 'a' had symbols like $, & in it. Though I haven't checked it for & but $ is definitely breaking my code
Any way to egrep for string with $ ??
One way I though was to replace every occurence of $ with $ in my search expression but that would involve an extra processing each time
View 10 Replies
View Related
Jan 26, 2010
Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing:
mkdir "new dir" and:
touch "new file.txt"
I want to rename files from:
imgp0882.jpg to something like:
20091231 1243 some topic.jpg
And how would it look in a shell script that uses parameters like:
for i in *.jpg do
rename "$i" "$somepath/$mydate $mytime $mytopic$extension"
?
I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming. If you want to see my script, here's a copy. I'm not using jhead for this renaming because that only works with JPEG files but I want a single solution for any media format including videos.
View 2 Replies
View Related
Jan 25, 2011
Have worked with Linux at home for some time and have wrote the below script.
This script is run when a .torrent file finishes downloading and extracts any .rar files into an extracted directory.
However there are 2 thing that i cannot for the life of me get working.
These are:
1. I need the script to check a txt file to see if the file has been extracted previously.
2. The script does not work with any paths that contain spaces.
Code:
View 11 Replies
View Related
Jan 7, 2010
I recently installed Linux Mint 8, which is an amazing distribution.I can get everything to work perfect, but I cannot figure out how to make the mouse wheel change desktops in compiz. Also, make sure that it only changes desktops when the mouse is over an empty desktop because I got it working once but the mouse wheel would change desktops all the time, even when I was trying to scroll through a webpage or document.
View 2 Replies
View Related
May 21, 2011
Server Apache doesn't work.Note the LOG line,you cannot modify or delete "logs/"
View 1 Replies
View Related
May 26, 2010
small office network with Linux CentOS 5.4 internet server. I use Squid 2.6.STABLE21. I have static IP.If I masquerade my small office net FTP works, but if I disable masquerade then FTP doesn't work through Squid.I was trying to stop iptables but the problem was the same.
View 9 Replies
View Related
Jun 1, 2010
I have a simple cron job that runs every night & I tested this manually by just running the command as root in bash and all worked fine. It took some time but the crob job finished and I got my results emailed to me perfect / as expected.
Here is root's cron job listing:
Code:
Now I noticed that I never ever got anything emailed to me the following day so I am wondering if perhaps the Cron daemon doesn't have permissions or has an issue running / executing the command rather than when I test the command as 'root'? When I view my logs, I can see the command being executed and don't see any errors however I don't get email results when Cron runs the job rather than me taking the command and running it manually in Bash...then it works. What am I missing?
Code:
View 9 Replies
View Related
Apr 17, 2011
host - ubunut 1010 desktop 64bit
virtualizer - VirtualBox ver 3.2.10 r66523
guest (VM) - ubuntu 1010 server 64bit
[code]....
View 1 Replies
View Related
Jul 25, 2011
My ftp server runs vsftp. The ftp passive ports stopped working while iptables is running, so users can't ls their dirs. I know that you need to load the modules of ip_conntrack and ip_conntrack_ftp, the problem is when I modprobe ip_conntrack I get the error: FATAL: Module ip_conntract_ftp not found. No that is not a typo. ip_conntract_ftp? Am I missing something?
View 2 Replies
View Related
Apr 25, 2011
I am trying to install some packages in a ubuntu 8.10 server, however, apt-get doesn't work (I get several 'not found' errors). Is there any way to do that? I know this version is probably not supported anymore but I can't just format a customer server because it's OS is outdated...I just can't put my sources.list on it because I am on ubuntu 10.10 and it would download updates for the wrong OS probably causing a huge damage on the old one.
View 9 Replies
View Related
May 1, 2011
Have done a fresh install of 11.04 32bit and after getting everything to work I have run into a 11.04 killer for me. PS3 Media Server don't work It doesn't detect the PS3 correctly and on the PS3 side it just keeps saying "data corrupted" for every video I try to play. It used to work perfectly on 10.04.
View 3 Replies
View Related
Mar 28, 2011
I have a computer that I would like to backup the home directory onto a server. I created a script called wien_backup.sh that contains the following:
#!/bin/bash -l
/usr/bin/rsync -rv --delete-after --ignore-errors -e /usr/bin/ssh root@wngr403-unix2:/home/ /space/systemimager/Wien/
where wngr403-unix2 is the computer I am backing up, and the script is ran from the server. If I run the script by itself, it works just fine. If I run it as a cronjob, the /var/log/syslog says it ran, but it does nothing.
View 6 Replies
View Related
May 22, 2011
postfix
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
[Code].....
Followed [URL] ubuntu 11.04 server
View 3 Replies
View Related
Jan 28, 2010
I used fedora12 builded mail server uning sendmail and dovecot at my home, when I at home everything are works fine, no matter I sent email to hotmail, or hotmail sent to my mail server, but I got the problem that I can't access my home server when I at office, the error messages as below:
#telnet xxx.xxx.xxx.xxx 110
-ERR Cannot connect to POP server xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx:110), connect error 10061
#telnet xxx.xxx.xxx.xxx 25
[code]....
P.S there is no firewall between the my office and home
View 3 Replies
View Related
Dec 17, 2010
I have a server that has snmp installed(Version is net-snmp-5.3.2.2-9.el5_5.1). This server has 5 n/w interfaces with diferent ip's. My problem is when i try snmpwalk on to the main interface, in my case "bond0" with the assigned ip address there is no response.
eg: snmpwalk v2c -c nature 172.17.241.190
No Response from 172.17.241.190
But when i run the same query with "localhost" snmpd responds.
eg: snmpwalk v2c -c nature localhost
[Code].....
I want to snmpwalk in to the "172.17.241.190".
View 2 Replies
View Related
Apr 28, 2010
I have a dedicated server running CentOS 5, Plesk 9.2.2, SMTP Postfix and Courier-IMAP.The issue I have is that on all domains on the server receiving email works fine however sending email never seems to work. This is from email programs, my phone, webmail and PHP. None of them seem to be able to send email. If it is of worth Spam Assassin is running however I don't feel it is causing any problems.
View 7 Replies
View Related
Apr 11, 2011
My mother runs Ubuntu 10.04 on her home computer, but on her workplace they use some version of Windows. Her IT-guy sent her a .rdp-file for logging in to her workplace server. This file doesn't work in Ubuntu, and the IT-department at her job can't solve the problem. Ergo; She's unable to log on to her workplace computer/server from home.
View 3 Replies
View Related
May 29, 2011
After I finished upgrading Xubuntu from 9.10 to 10.04, I discovered that my keyboard stopped working in X Server. The upgrade process was running smoothly until the last moment, when it produced some error, which I, unfortunately, did not write down. Anyway, the upgrade has completed; uname shows kernel version 2.6.32-31. Now the keyboard works fine if I select a recovery mode at startup, but if I type 'start gdm' from the shell or select the default option in GRUB while booting, the keyboard becomes unavailable right from the login screen. I can log on using the virtual keyboard, but that's all I can do; the keyboard is still dead.
View 5 Replies
View Related
Dec 5, 2010
I can see that in yum-updatesd configuration i can use smtp_server to rely mail notifications as per below outputs from man pages smtp_server SMTP server to use when sending mail, host or a hostort string. Defaults to localhost:25. The problem that this option doesn't work at all and it rely into the local MTA not the one set on the smtp_server
View 2 Replies
View Related
Oct 5, 2010
Code:
nnjond@nnjond-den:/$ cd /media/disk/Dual_Data/
nnjond@nnjond-den:/media/disk/Dual_Data$ ls
07_Magna_DOWNLOADS 21_TEMPS Peleas.htm
08_Self-Improvement 22_Desktop Pelleas.odt
[code]....
View 6 Replies
View Related
Feb 7, 2010
So here is what I'm trying to do: I want to share a folder and have it so that guests can access it, but only read. I also want to make it possible that I can mount it as a network drive on my Windows 7 machine and login with my linux account so that I can have write access. This is from a completely stock Ubuntu 8.10 and Samba config. Everytime I've tried I've failed to get it working.
View 1 Replies
View Related
Sep 28, 2010
Using Fedore 12 I am trying to mount on a server with the following command: # mount -t cifs //samba-pool-suse/pool-suse /mnt -o user=xxxx I was waiting that the system askme the user password and thats all, but the answer is: mount: wrong fs type, bad option, bad superblock on //samba-pool-suse/pool-suse, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so using:# dmesg | tail returs: CIFS VFS: cifs_mount failed w/return code = -22
View 3 Replies
View Related
Nov 19, 2009
Trying to migrate our news server to a new instance on centos5 and having issues with the makehistory utility. It errors out and then just creates all null values for the overview database. Here is the output:
[root@server overview]# /usr/lib/news/bin/makehistory -O -x -F
*** glibc detected *** /usr/lib/news/bin/makehistory: free(): invalid pointer: 0x000000000063ce60 ***
======= Backtrace: =========
[Code].....
View 12 Replies
View Related
Dec 29, 2010
Am trying to do a mount of a Windows folder onto Linux. The path has some spaces in it like //hostname/path 1/path 2/path 3. How I should handle this?
View 6 Replies
View Related
Apr 12, 2011
when i am enabling mysql in server (port 3306) it does'nt work. but when i execute iptables -F it works what may be the reson?
View 6 Replies
View Related
Jun 1, 2011
I am trying to setup forward mails to a user in my linux server to procmail. But that doesn't work. My $HOME/.forward looks like the following
[Code]....
View 7 Replies
View Related
Aug 3, 2010
I've been having this problem since 10.6 released, but have until now been successful with the "just use Thunderbird" response. My sendmail server hasn't been changed, but as clients upgrade from OSX 10.5 to 10.6 suddenly mail.app will no longer connects to send SMTP messages through the server. (IMAP connections to the same server using the same user/pass combinations work perfectly) When I look at the logs, things basically stop right after the STARTTLS command.
Google indicates alot of people are having similar problems, but I'm not seeing any solutions. Do any of you administrate sendmail servers where some of your clients are using Apple's Mail.app on Snow Leopard, and if so what settings are you using? At this point, I'm happy to make changes to the server to accommodate Apple's issue, I have too many Mac users connecting to my server. I just can't figure out what to change. I've enabled virtually every possible login authentication combination, and none of them work.
View 1 Replies
View Related
Jun 30, 2010
I've been trying to make install apache 2.1.8 and php 5.2.3 and work on them. After updating and installing some dependence files, apache and php could both be installed.
Then I tried to configure them. I added the following content to the end of Apache httpd.conf:
Code:
Then I run /path/to/apachectl start, and saw the message:
Quote:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Then I remembered that I didn't include the rewrite module while making install apache. So I removed the 2 lines I just added to httpd.conf.
But, after running /path/to/apachectl stop and start again, I could still see:
Code:
When I use firefox to open http://host_ip:8080/, I could see "It works!". But when I open http://host_ip:8080/hello.php (the file is already under htdocs), firefox said
Quote:
Failed to Connect
Why and how to solve it?
I noticed that for some stupid reason, the conf file wasn't updated at all and the 2 erroneous lines were still there.
View 91 Replies
View Related