Changeset 41508 for trunk/tools/eam/rebalance/rebalance.mana
- Timestamp:
- Feb 25, 2021, 4:33:46 PM (5 years ago)
- Location:
- trunk/tools/eam/rebalance
- Files:
-
- 1 edited
- 1 copied
-
. (copied) (copied from trunk/tools/eam/rebalance )
-
rebalance.mana (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rebalance/rebalance.mana
r41407 r41508 261 261 262 262 echo "rsyncing $srcdir/ to $tgtdir/ : $movelog" 263 break -auto off 263 264 exec rsync -auv --files-from=$movelist $srcdir/ $tgtdir/ >& $movelog 265 break -auto on 264 266 end 265 267 end … … 388 390 end 389 391 390 local srchost tgthost srcvol tgtvol 392 local srchost tgthost srcvol tgtvol isFound myfile 391 393 392 394 $srchost = $1 … … 415 417 for j 0 $files:n 416 418 # move the file to the trash directory 417 echo mv $srcdir/$files:$j $trashdir 418 exec mv $srcdir/$files:$j $trashdir 419 420 $myfile = $srcdir/$files:$j 421 file $myfile isFound 422 if (not($isFound)) 423 echo "$myfile not found, skipping" 424 continue 425 end 426 echo mv $myfile $trashdir 427 exec mv $myfile $trashdir 419 428 end 420 429 end … … 463 472 else 464 473 echo "SUCCESS: no check errors detected" 474 end 475 end 476 477 # names are defined for a single src & tgt pair 478 macro run.location.check 479 if ($0 != 6) 480 echo "USAGE: run.location.check (srchost) (srcvol) (tgthost) (tgtvol) (VERSION)" 481 echo "srchost, tgthost : e.g., ipp070" 482 echo "srcvol, tgtvol : e.g., 0 (for /data/ipp070.0/nebulous)" 483 break 484 end 485 486 local srchost tgthost srcvol tgtvol 487 488 $srchost = $1 489 $srcvol = $2 490 491 $source = /data/$srchost.$srcvol/nebulous 492 493 $tgthost = $3 494 $tgtvol = $4 495 $VERSION = $5 496 497 $myhost = `hostname` 498 if ("$myhost" != "$tgthost") 499 echo "please run on $tgthost" 500 break 501 end 502 503 # I have a list of files in 'movelist' for which I want to check copy locations 504 # if the neb-entries have number of user copies != 2, the file is OK 505 # if the neb-entries is >= 2, one should be on a backup node 506 507 for i 0 $NSUBDIR 508 sprintf srcdir "%s/%02x" $source $i 509 sprintf subdir "%02x" $i 510 511 # generate initial file list (all big files) 512 sprintf movelist %s/rebalance/movefiles.%s.txt $srcdir $VERSION 513 sprintf checklog %s/rebalance/movefiles.%s.loc $srcdir $VERSION 514 515 echo ./neb_check_location.pl --tgthost $tgthost --tgtvol $tgtvol --subdir $subdir --list $movelist > $checklog 516 $EXEC ./neb_check_location.pl --tgthost $tgthost --tgtvol $tgtvol --subdir $subdir --list $movelist > $checklog 517 end 518 end 519 520 # names are defined for a single src & tgt pair 521 macro run.location.fix 522 if ($0 != 6) 523 echo "USAGE: run.location.fix (srchost) (srcvol) (tgthost) (tgtvol) (VERSION)" 524 echo "srchost, tgthost : e.g., ipp070" 525 echo "srcvol, tgtvol : e.g., 0 (for /data/ipp070.0/nebulous)" 526 break 527 end 528 529 local srchost tgthost srcvol tgtvol 530 531 $srchost = $1 532 $srcvol = $2 533 534 $source = /data/$srchost.$srcvol/nebulous 535 536 $tgthost = $3 537 $tgtvol = $4 538 $VERSION = $5 539 540 $myhost = `hostname` 541 if ("$myhost" != "$tgthost") 542 echo "please run on $tgthost" 543 break 544 end 545 546 # I have a list of files in 'movelist' for which I want to check copy locations 547 # if the neb-entries have number of user copies != 2, the file is OK 548 # if the neb-entries is >= 2, one should be on a backup node 549 550 for i 0 $NSUBDIR 551 sprintf srcdir "%s/%02x" $source $i 552 sprintf subdir "%02x" $i 553 554 # generate initial file list (all big files) 555 sprintf movelist %s/rebalance/movefiles.%s.txt $srcdir $VERSION 556 sprintf checklog %s/rebalance/movefiles.%s.loc $srcdir $VERSION 557 558 echo ./neb_check_location.pl --tgthost $tgthost --tgtvol $tgtvol --subdir $subdir --list $movelist > $checklog 465 559 end 466 560 end … … 513 607 echo "USAGE: rebalance.mana (MODE) (srchost) (srcvol) (tgthost) (tgtvol) (VERSION) [options]" 514 608 echo "" 515 echo "MODE: find.test, find, rsync, rsync.check, insert, insert.check, trash, trash.check, empty.trash"609 echo "MODE: find.test, find, rsync, rsync.check, insert, insert.check, location.check, trash, trash.check, empty.trash" 516 610 echo "" 517 611 echo "srchost, tgthost : e.g., ipp070" … … 604 698 end 605 699 700 #### location.check #### 701 if ("$argv:0" == "location.check") 702 if ($argv:n != 6) 703 echo "USAGE: rebalance.mana (location.check) (srchost) (srcvol) (tgthost) (tgtvol) (VERSION)" 704 break 705 end 706 run.location.check $argv:1 $argv:2 $argv:3 $argv:4 $argv:5 707 exit 0 708 end 709 710 #### location.fix #### 711 if ("$argv:0" == "location.fix") 712 if ($argv:n != 6) 713 echo "USAGE: rebalance.mana (location.fix) (srchost) (srcvol) (tgthost) (tgtvol) (VERSION)" 714 break 715 end 716 run.location.fix $argv:1 $argv:2 $argv:3 $argv:4 $argv:5 717 exit 0 718 end 719 606 720 #### empty.trash #### 607 721 if ("$argv:0" == "empty.trash")
Note:
See TracChangeset
for help on using the changeset viewer.
