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$
|
||||
# $URL$
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
JOBSDIR = "jobs"
|
||||
PARKDIR = "park"
|
||||
|
|
@ -190,7 +191,7 @@ def parkjobs
|
|||
if file == '.' or file == '..'
|
||||
next
|
||||
end
|
||||
File.move("#{@basedir}/#{JOBSDIR}/#{file}", "#{@basedir}/#{PARKDIR}")
|
||||
FileUtils.mv("#{@basedir}/#{JOBSDIR}/#{file}", "#{@basedir}/#{PARKDIR}")
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -199,7 +200,7 @@ def unparkjobs
|
|||
if file == '.' or file == '..'
|
||||
next
|
||||
end
|
||||
File.move("#{@basedir}/#{PARKDIR}/#{file}", "#{@basedir}/#{JOBSDIR}")
|
||||
FileUtils.mv("#{@basedir}/#{PARKDIR}/#{file}", "#{@basedir}/#{JOBSDIR}")
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -211,7 +212,7 @@ def unfail
|
|||
else
|
||||
jobnumber = sprintf("%06d", jobnumber.to_i)
|
||||
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
|
||||
system("rm", "-rf", "#{@basedir}/#{FAILDIR}/#{jobnumber}")
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue