35 #include <sys/param.h>
56 char pDir[MAXPATHLEN], *dotP, *dirFN, *lDir = Opt.Args[1];
57 char *dirP = pDir +
Config.xfrFdln;
58 int dirL =
sizeof(pDir) -
Config.xfrFdln;
60 int ec, rc = 0, num = 0;
68 do {
if (!
Config.LocalPath(lDir, dirP, dirL))
continue;
72 {
if ((dotP = rindex(fP->
File,
'.')) && !strcmp(dotP,
".fail"))
73 {Msg(fP->
Path); num++;}
74 nP = fP->
Next;
delete fP;
79 }
while((dirFN = Spec.
getarg()));
83 sprintf(pDir,
"%d fail file%s found.", num, (num == 1 ?
"" :
"s"));
97 char buff[128], pDir[MAXPATHLEN], *lDir = Opt.Args[1];
99 int mFlag,
ec = 0, rc = 0, num = 0;
103 do {
if (!
Config.LocalPath(lDir, pDir,
sizeof(pDir)))
continue;
105 while((sP = fP->
Get(
ec)))
107 && (mFlag = memInfo.
Attr.Flags))
110 Msg(
"mmap ", Kp, Lk, sP->
basePath()); num++;
116 }
while((lDir = Spec.
getarg()));
120 sprintf(buff,
"%d mmapped file%s found.",num,(num == 1 ?
"" :
"s"));
133 char buff[128], pDir[MAXPATHLEN], *lDir = Opt.Args[1];
135 int ec = 0, rc = 0, num = 0;
140 {Emsg(
"Checksum support has not been configured!");
return 8;}
145 if (!(CksData.Length =
Config.CksMan->Size(Opt.Args[1]))
146 || !CksData.Set(Opt.Args[1]))
147 {Emsg(Opt.Args[1],
" checksum is not supported.");
return 4;}
151 if (!(lDir = Spec.
getarg()))
152 {Emsg(
"Find target not specified.");
return 4;}
156 do {
if (!
Config.LocalPath(lDir, pDir,
sizeof(pDir)))
continue;
158 while((sP = fP->
Get(
ec)))
161 Msg((rc == -ESTALE ?
"Invalid " :
"Missing "), CksData.Name,
168 }
while((lDir = Spec.
getarg()));
172 sprintf(buff,
"%d file%s found with no chksum.",num,(num == 1 ?
"" :
"s"));
185 char buff[128], pDir[MAXPATHLEN], *lDir = Opt.Args[1];
187 int ec = 0, rc = 0, num = 0;
191 do {
if (!
Config.LocalPath(lDir, pDir,
sizeof(pDir)))
continue;
193 while((sP = fP->
Get(
ec)))
199 }
while((lDir = Spec.
getarg()));
203 sprintf(buff,
"%d pinned file%s found.",num,(num == 1 ?
"" :
"s"));
212 static const int Week = 7*24*60*60;
214 const char *Pfx =
"+";
215 char How[256], Scale;
225 {Msg(
"pin -k forever ", sP->
basePath());
return 1;}
236 {time_t nowT = time(0);
238 if ((pinVal - nowT) <= Week)
240 pinVal = pinVal - nowT;
243 struct tm *lclTime = localtime(&pinVal);
244 sprintf(How,
"-k %02d/%02d/%04d", lclTime->tm_mon+1,
245 lclTime->tm_mday, lclTime->tm_year+1900);
252 {
if ( pinVal <= 180) Scale =
's';
253 else if ((pinVal /= 60) <= 90) Scale =
'm';
254 else if ((pinVal /= 60) <= 45) Scale =
'h';
255 else { pinVal /= 24; Scale =
'd';}
256 sprintf(How,
"-k %s%d%c", Pfx,
static_cast<int>(pinVal), Scale);
257 }
else if (!*How)
return 0;
261 Msg(
"pin ", How,
" ", sP->
basePath());
271 static const char *noCPT =
"Unmigrated; no copy time: ";
275 char buff[128], pDir[MAXPATHLEN], *lDir = Opt.Args[1];
277 int ec = 0, rc = 0, num = 0;
281 do {
if (!
Config.LocalPath(lDir, pDir,
sizeof(pDir)))
continue;
283 while((sP = fP->
Get(
ec)))
286 else if (
static_cast<long long>(sP->
baseFile()->
Stat.st_mtime) >
288 Why=
"Unmigrated; modified: ";
290 if (Why) {Msg(Why, sP->
basePath()); num++;}
295 }
while((lDir = Spec.
getarg()));
299 sprintf(buff,
"%d unmigrated file%s found.",num,(num == 1 ?
"" :
"s"));
static const char memKeep
static const char memLock
static const char pinKeep
static const char pinPerm
static const char pinIdle
static const int NoAutoDel
static const int GetCpyTim
XrdFrmFileset * Get(int &rc, int noBase=0)
static const int Recursive
XrdOucXAttr< XrdFrcXAttrCpy > cpyInfo
XrdOucXAttr< XrdFrcXAttrPin > pinInfo
XrdOucNSWalk::NSEnt * baseFile()
NSEnt * Index(int &rc, const char **dPath=0)
int Get(const char *Path, int fd=-1)
int Del(const char *Path, int fd=-1)