Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Purging/Trimming script in Ubuntu 10.10 not working?
New Posts  All Forums:Forum Nav:

Purging/Trimming script in Ubuntu 10.10 not working? - Page 3

post #21 of 45
Quote:
Originally Posted by Plan9 View Post


Might be actually.
I don't use -exec often but I'm pretty sure the point of it is you're escaping the semi-colon (ie marking the end of the rm command) where as what you're doing is escaping the escape char then using the semi-colon to mark the end of the find command (which is redundant in this instance as the EOL char will do the same thing).
I can never remember why the brackets are needed though.
@stu.
in the find command, replace \\; with \; (ie delete one of the forward slashes), then try in the terminal like last time


off topic: I think the brackets are there to so -exec knows where to put the find strings in the command, I could be wrong tho.

 

Bazinga Punk
(12 items)
 
ooh shiny!
(6 items)
 
 
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
CPUMotherboardGraphicsRAM
Intel Core I5 6500 Gigabyte z170xp-SLI Nvidia 970gtx Corsair 16gb ddr4 2666mhz  
Hard DriveOS
250gb Samsung Evo 850 Windows 10 & Ubuntu 15.10 
  hide details  
Reply
Bazinga Punk
(12 items)
 
ooh shiny!
(6 items)
 
 
CPUMotherboardGraphicsRAM
Intel Xeon 3440 AsRock P55 extreme Evga 8800 GT 512 MB Gskill Ripjaws 
Hard DriveCoolingOSMonitor
Western Digital Blue Antec Khuler 620 Ubuntu 11.10 Asus vw264H 
KeyboardPowerCaseMouse
GIGABYTE KM7600 CORSAIR TX 650 Cooler Master 590 GIGABYTE GM-M6800 
CPUMotherboardGraphicsRAM
Intel Core I5 6500 Gigabyte z170xp-SLI Nvidia 970gtx Corsair 16gb ddr4 2666mhz  
Hard DriveOS
250gb Samsung Evo 850 Windows 10 & Ubuntu 15.10 
  hide details  
Reply
post #22 of 45
Quote:
Originally Posted by Transhour View Post



off topic: I think the brackets are there to so -exec knows where to put the find strings in the command, I could be wrong tho.

That would make sense smile.gif
post #23 of 45
Thread Starter 
Well, that produced thousands of lines of results... and deleted the entire contents backup folder... haha. Not a single folder remained! wth.gif
 
F@H
(14 items)
 
 
CPUMotherboardGraphicsRAM
Core i7 920 @ 4.0ghz EVGA x58 132-BL-E758-A1 2x EVGA 460 1 GB G.SKILL 3 x 2 GB 
Hard DriveOSMonitorKeyboard
Mushkin 40 GB SSD / WD Black 1 TB Windows 7 Home Premium 64-bit DCLCD 20.1" Logitech G15 
PowerCaseMouse
Antec TP 750 Antec 900 Logitech G5 
CPUMotherboardRAMCooling
i7 2700k ASUS Maximus Gene-Z z68 G.Skill 2133mhz Noctua NH-D14 
OSPowerCase
Ubuntu 10.10 BFG 650 Silverstone TJ08-E 
  hide details  
Reply
 
F@H
(14 items)
 
 
CPUMotherboardGraphicsRAM
Core i7 920 @ 4.0ghz EVGA x58 132-BL-E758-A1 2x EVGA 460 1 GB G.SKILL 3 x 2 GB 
Hard DriveOSMonitorKeyboard
Mushkin 40 GB SSD / WD Black 1 TB Windows 7 Home Premium 64-bit DCLCD 20.1" Logitech G15 
PowerCaseMouse
Antec TP 750 Antec 900 Logitech G5 
CPUMotherboardRAMCooling
i7 2700k ASUS Maximus Gene-Z z68 G.Skill 2133mhz Noctua NH-D14 
OSPowerCase
Ubuntu 10.10 BFG 650 Silverstone TJ08-E 
  hide details  
Reply
post #24 of 45
Hmm, I'm guessing it's treating the find command and exec command as independent. If you run that exec command on it's own, that's what you get. You could use a pipe, I think?
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
post #25 of 45
Quote:
Originally Posted by stu. View Post

Well, that produced thousands of lines of results... and deleted the entire contents backup folder... haha. Not a single folder remained! wth.gif
then I think the date parameter on find is incorrect.
will check tonight if nobody else has done so by then
Quote:
Originally Posted by chemicalfan View Post

Hmm, I'm guessing it's treating the find command and exec command as independent. If you run that exec command on it's own, that's what you get. You could use a pipe, I think?
I can't see how that could ever happen as the exec command is just a parameter.
Piping would work (and I nearly suggested it myself last night), but it would be less efficient code. That said, i don't think efficiency matters in this scenario.
post #26 of 45
redface.gif
Oops, I didn't know about the find command, probably should have researched it first!
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
post #27 of 45
oh hang on, that script had worked perfectly when it deleted everything. What it's doing is looking for the file modification date and seeing if it's older than 720mins. However I got you to run a chmod and chown just before re-running the script, so the modification time would have been updated. doh!

anyhow, it should be running fine now smile.gif
post #28 of 45
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

oh hang on, that script had worked perfectly when it deleted everything. What it's doing is looking for the file modification date and seeing if it's older than 720mins. However I got you to run a chmod and chown just before re-running the script, so the modification time would have been updated. doh!

anyhow, it should be running fine now smile.gif

But if everything had just been updated, wouldn't NOTHING be older than 720 minutes? Thus nothing should have been deleted?
 
F@H
(14 items)
 
 
CPUMotherboardGraphicsRAM
Core i7 920 @ 4.0ghz EVGA x58 132-BL-E758-A1 2x EVGA 460 1 GB G.SKILL 3 x 2 GB 
Hard DriveOSMonitorKeyboard
Mushkin 40 GB SSD / WD Black 1 TB Windows 7 Home Premium 64-bit DCLCD 20.1" Logitech G15 
PowerCaseMouse
Antec TP 750 Antec 900 Logitech G5 
CPUMotherboardRAMCooling
i7 2700k ASUS Maximus Gene-Z z68 G.Skill 2133mhz Noctua NH-D14 
OSPowerCase
Ubuntu 10.10 BFG 650 Silverstone TJ08-E 
  hide details  
Reply
 
F@H
(14 items)
 
 
CPUMotherboardGraphicsRAM
Core i7 920 @ 4.0ghz EVGA x58 132-BL-E758-A1 2x EVGA 460 1 GB G.SKILL 3 x 2 GB 
Hard DriveOSMonitorKeyboard
Mushkin 40 GB SSD / WD Black 1 TB Windows 7 Home Premium 64-bit DCLCD 20.1" Logitech G15 
PowerCaseMouse
Antec TP 750 Antec 900 Logitech G5 
CPUMotherboardRAMCooling
i7 2700k ASUS Maximus Gene-Z z68 G.Skill 2133mhz Noctua NH-D14 
OSPowerCase
Ubuntu 10.10 BFG 650 Silverstone TJ08-E 
  hide details  
Reply
post #29 of 45
Maybe the script is looking for YOUNGER than 720 minutes, you may invert it?
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
post #30 of 45
Quote:
Originally Posted by stu. View Post

But if everything had just been updated, wouldn't NOTHING be older than 720 minutes? Thus nothing should have been deleted?
Good point.
Quote:
Originally Posted by chemicalfan View Post

Maybe the script is looking for YOUNGER than 720 minutes, you may invert it?
Nope, the script appears to be correct.

I'm starting to wonder if Ubuntu properly supports -mmin as I have heard of cases where it's incompatible with *nix systems (though I'd be amazed if GNU find hasn't since implemented it).

However he could try relacing -mmin 720 with -mtime 1 -mtime +1
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Purging/Trimming script in Ubuntu 10.10 not working?