LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-03-2016, 04:07 AM   #16
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721

The line that looks like it is intended to delete them would be towards the bottom:

Code:
+ find -O3 /var/lib/php/sessions -depth -mindepth 1 -name sess_* -ignore_readdir_race -type f -cmin +1440 -delete
What happens when you modify it to just show what it finds and then run it manually?


Code:
find -O3 /var/lib/php/sessions -depth -mindepth 1 -name sess_* -ignore_readdir_race -type f -cmin +1440 -print
Does it find anything at all?
 
Old 06-03-2016, 04:16 AM   #17
mdotk
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Code:
root@web:~# find -O3 /var/lib/php/sessions -depth -mindepth 1 -name sess_* -ignore_readdir_race -type f -cmin +1440 -print
find: warning: you have specified the -ignore_readdir_race option after a non-option argument -name, but options are not positional (-ignore_readdir_race affects tests specified before it as well as those specified after it).  Please specify options before other arguments.
 
Old 06-03-2016, 04:45 AM   #18
mdotk
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Switched the variables and ran this, and got nothing back:

Code:
root@web:~# find -O3 /var/lib/php/sessions -depth -mindepth 1 -ignore_readdir_race -name sess_* -type f -cmin +1440 -print
root@web:~#
 
Old 06-03-2016, 04:49 AM   #19
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Ok. Their script has a bug in it. The correct order should have -ignore_readdir_race ahead of -name. Also I had forgotten the quotes needed above in -name:

Code:
find /var/lib/php/sessions -depth -mindepth 1 -ignore_readdir_race -name 'sess_*' -type f -cmin +1440 -print
If that does not print anything, try eliminating the age requirement

Code:
find /var/lib/php/sessions -depth -mindepth 1 -ignore_readdir_race -name 'sess_*' -type f -print
The manual page for "find" has a list of what the options do, but it may be helpful to know that there is an implied logical AND between the options unless specified otherwise.
 
Old 06-04-2016, 05:36 AM   #20
mdotk
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Update: the problem is solved! Changing the directory to "/var/lib/php/sessions" and also hardcoding the variables seemed to work! Thank you so much for your help it has been much appreciated!

I now have some pesky hidden folders in each of the old sessions directories that I am trying to delete:

Code:
root@web:/var/lib/hhvm/sessions# ls -al
total 109860
drwx-wx-wt 2 root root 112484352 Jun  1 15:49 .
drwxr-xr-x 3 root root      4096 Apr 30  2015 ..
root@web:/var/lib/hhvm/sessions# stat .
  File: ‘.’
  Size: 112484352 	Blocks: 219712     IO Block: 4096   directory
Device: fc00h/64512d	Inode: 397720      Links: 2
Access: (1733/drwx-wx-wt)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-06-03 13:47:55.401411156 -0400
Modify: 2016-06-01 15:49:29.422304013 -0400
Change: 2016-06-01 15:49:29.422304013 -0400
 Birth: -
root@web:/var/lib/hhvm/sessions# rm -rf .
rm: cannot remove directory: ‘.’
 
Old 06-04-2016, 05:44 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
. and .. cannot be removed
 
Old 06-04-2016, 05:46 AM   #22
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Excellent. Just remember later that the directories an other items are hardcoded.

The dot . and double dot .. directories are shortcuts. The single dot . is a shortcut meaning the current directory. The double dot means the directory above the current directory. It's probably not a good idea to erase those.

If you're moving around directories a lot in a single window you might look at 'cd -' which hops you back to the previous directory. Or else 'pushd .' and 'popd' are useful to hop around. Of course its also easy to just open another terminal window.
 
1 members found this post helpful.
Old 06-05-2016, 04:45 AM   #23
mdotk
LQ Newbie
 
Registered: May 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks again guys
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recoll indexing throwing strange errors on some files. taylorkh Linux - Software 1 12-21-2010 02:28 AM
pygtk configure throwing odd errors. ninja master Linux - Software 2 07-28-2010 03:22 AM
New Cavalry external USB HD throwing errors peter3731 Linux - Hardware 0 02-10-2008 01:26 AM
Kernel 2.6.19 throwing up hd read errors cr9c1 Slackware 6 12-18-2006 04:01 PM
GCC First Pass throwing errors...pls help! chakkaradeepcc Linux From Scratch 2 04-11-2005 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration