rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rleidt

Pages: 1
1
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 16, 2016, 01:50:47 PM »
So for 3 days from time of upload to delete but no deletion done Saturday, Sunday or Monday I would add into it like this (below) and set the #days to 3 as before ?

Or maybe DJ's post (just before this post) works too:

"if Sunday then 3
else if Saturday then 2
else 1

Code: [Select]
{. if |{.{.time|ddd.}=Sun.} | 3 | {:{.if|{.{.time|ddd.}=Sat.}|2|1.}:} .}

Can one of you piece this together so that I can copy and paste to test. In the end I'd just like to know where to set the # of days before deletion. I apologize again for not knowing this language but very happy you all jumped on the challenge.

********

[file=folder=link|private]

[at 0:00]
{.set|#actionday|0.}
{.for each|theday|,|tuesday,wednesday,thursday,friday|{:{if|{.=|{.lower|{.time|dddd.}.}|{.^theday.}/=.}|{:{.set|#actionday|1.}:}/if.}:}/switch.}

{.if|{.and|{.is file|%item-resource%.}|{.>|{.round|{.calc|%now%-%item-modified-dt%.}.}|3.}/and.}|
{:{.delete|%item-resource%|bin=0|forced=1.}:}|

[+file=+folder=+link|private]
   <tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
        <input type='checkbox' class='selector' name='selection' value="%item-url%" {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
      {.if|{.is file protected|%item-name%.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
      {.if not|{.get|can access.}|<img src='/~img_lock'>.}
      <a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
      {.if| {.length|{.?search.}.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
      {.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}

[+file]
<td>%item-size%B<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%

[+folder]
<td class='nosize'>folder<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%

[+link]
<td class='nosize'>link<td colspan='2'>

[+file=+folder=+link|private]
/if.}

2
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 12, 2016, 12:48:36 PM »
DJ, Re:

{. if |{.{.time|ddd.}=Sun.} | 2 | 1 .}

Can this code have Saturday added to it? Like ' or if  {.time|ddd.}=Sat.}. '

(Excuse me for not being a programmer. I did some "basic" many years ago and still do some fancy batch files now and again.)

3
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 09, 2016, 05:38:00 PM »
I'll have to test again as a sanity check. I'm 100%sure my files were there over 24 hours after the upload with days set to 1. Maybe because my login hadn't expired? It seems to hang on for quite a while. I never really took much notice to how long before it times out and I need to re-enter credentials.

I wonder how difficult it would be to have it not delete on a Saturday or Sunday? If someone uploads a file at 4:00 Friday PM I'd want to there for Monday, however during the week I only want it there for the next day. The odd long weekend shouldn't be a terribly big issue. Everyone here bails out early on the Friday before anyway, it seems.

4
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 09, 2016, 11:48:17 AM »
OK, the day before yesterday I set up the folders and had the script set to delete after 1 day.

Some files were uploaded in the AM and some later in the day. Mid day nothing had been deleted. I was quite busy in the PM and didn't check, but this morning all the test files were gone.

I don't understand the script language but maybe "round" takes the file date to midnight? If so then perhaps these were all deleted at midnight 1 day later? That would make it wipe, in this case, a minimum of 1 day and not more than two from the time of upload, which would be perfect. I assume if set to, say, 30 days it would delete between 30 and 31 days of the time of upload.

Is this what it was supposed to do of should those files uploaded two mornings ago have been deleted yesterday morning (24 hours later)?

Thank, Bob

Oh, two other questions:
How would I put a REM line into this. I'd like to add instruction just before Line 2 on how to set the # of days.
Is there any sort of limit? (like can I set it for five years (however many days that would be))

5
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 06, 2016, 05:12:51 PM »
Cool!

This is counting days from the time the file is uploaded to HFS? (as opposed to the creation date of the file). If so, it's exactly what I need and seems like it would be steps away from being in the GUI, if there was a desire to add the feature. "0" would have to mean "don't expire".  Some users might want to be able to take it down to hours, but days works for me.

Thanks!,
Bob

Edit:
Oh, I see your using a utility to change the date/time. Users uploading would all be required to do that including our clients. That's not going to work for me.

Next edit:
I just uploaded a file and the date of the file was changed to the current date which means this should work.

I've made a test folder with 5 additional levels of folders. Level 4 purposely has no files uploaded and levels 1,2,3,5 and 6 have varying numbers of files. I've set the days to "1" (or in your language "1." LOL). I've also thrown in extra empty and populated folders at a couple of levels. I'll report back tomorrow or Friday.

6
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 02, 2016, 05:41:14 PM »
I don't see anything here that solves the issue when new subfolders are created except "forfiles". However, "forfiles" is based on the date of the file modification, not when it was uploaded to HFS. Maybe in the HFS scripting, but that's beyond me.

Another useful option might be to delete after x successful downloads, but I think the expiry would still be very important for me.

Thank you!

7
HFS ~ HTTP File Server / set expiry to delete content
« on: September 02, 2016, 01:04:59 PM »
I would be nice to be able to set expiry date on folders so that any posted file would be auto-deleted within "x hours/days/etc." time of it being uploaded. At minimal the root folder and all sub folders, but would be nicer if it could be set differently for each folder.

For me I'm thinking at the HFS console, but others may want an option for the users to be able to set also. Maybe even at the file level.

If just at the console at the root directory (inherited by sub directories) that would be a nice start.

If this can't be done, what happened to the option to allow/disallow folder creation? I am currently using a batch file and task manager to clean up, but people keep making folders which the batch file doesn't know about.

I moved from an FTP server to HFS many years ago because it allowed me to easily remove files on a schedule using batch files after a manger found staff had left confidential material in a folder for many months. That folder was intended for general info with credentials shared with many of our clients. Now I am faced with the same problem (using Ver 2.3i).

I think an expiry feature would make HFS complete.

Pages: 1