fix file moves
This commit is contained in:
parent
3088d578f5
commit
7214260e3c
1 changed files with 4 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
# $URL$
|
# $URL$
|
||||||
|
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
JOBSDIR = "jobs"
|
JOBSDIR = "jobs"
|
||||||
PARKDIR = "park"
|
PARKDIR = "park"
|
||||||
|
|
@ -190,7 +191,7 @@ def parkjobs
|
||||||
if file == '.' or file == '..'
|
if file == '.' or file == '..'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
File.move("#{@basedir}/#{JOBSDIR}/#{file}", "#{@basedir}/#{PARKDIR}")
|
FileUtils.mv("#{@basedir}/#{JOBSDIR}/#{file}", "#{@basedir}/#{PARKDIR}")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -199,7 +200,7 @@ def unparkjobs
|
||||||
if file == '.' or file == '..'
|
if file == '.' or file == '..'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
File.move("#{@basedir}/#{PARKDIR}/#{file}", "#{@basedir}/#{JOBSDIR}")
|
FileUtils.mv("#{@basedir}/#{PARKDIR}/#{file}", "#{@basedir}/#{JOBSDIR}")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -211,7 +212,7 @@ def unfail
|
||||||
else
|
else
|
||||||
jobnumber = sprintf("%06d", jobnumber.to_i)
|
jobnumber = sprintf("%06d", jobnumber.to_i)
|
||||||
if FileTest.exists?("#{@basedir}/#{FAILDIR}/#{jobnumber}/job")
|
if FileTest.exists?("#{@basedir}/#{FAILDIR}/#{jobnumber}/job")
|
||||||
File.move("#{@basedir}/#{FAILDIR}/#{jobnumber}/job", "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
FileUtils.mv("#{@basedir}/#{FAILDIR}/#{jobnumber}/job", "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
|
||||||
# XXX tja, lekker makkelijk even geen recursie implementeren
|
# XXX tja, lekker makkelijk even geen recursie implementeren
|
||||||
system("rm", "-rf", "#{@basedir}/#{FAILDIR}/#{jobnumber}")
|
system("rm", "-rf", "#{@basedir}/#{FAILDIR}/#{jobnumber}")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue