remove dummy files
This commit is contained in:
parent
10c4ebdb98
commit
373ead9a97
|
@ -1 +0,0 @@
|
||||||
1
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
|
|
||||||
set files (./golf lol)
|
|
||||||
|
|
||||||
|
|
||||||
echo (count $files)
|
|
||||||
|
|
||||||
|
|
19
count.mockup
19
count.mockup
|
@ -1,19 +0,0 @@
|
||||||
files = number of files in arg[1] # likely going to be named sql-backup
|
|
||||||
|
|
||||||
if files > arg[2] # specified number of files to keep
|
|
||||||
|
|
||||||
fileList = array of files in arg[1]
|
|
||||||
oldestDate = fileList[1] date created # doesn't matter which file
|
|
||||||
fileIndex = 1 # or 0 but fish just uses index 1 for the beginning of an array
|
|
||||||
|
|
||||||
for i = 1; i > files; i++
|
|
||||||
|
|
||||||
dateCreated = fileList[i] date created
|
|
||||||
if oldestDate < dateCreated
|
|
||||||
oldestDate = dateCreated
|
|
||||||
fileIndex = i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
delete fileList[fileIndex]
|
|
||||||
end
|
|
Loading…
Reference in New Issue