Advertisement
metalx1000

Fix Time Stamp Modification time for Nextcloud error

May 27th, 2021
2,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.44 KB | None | 0 0
  1. #!/bin/bash
  2. ######################################################################
  3. #Copyright (C) 2021  Kris Occhipinti
  4. #https://filmsbykris.com
  5.  
  6. #This program is free software: you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation, either version 3 of the License, or
  9. #(at your option) any later version.
  10.  
  11. #This program is distributed in the hope that it will be useful,
  12. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. #GNU General Public License for more details.
  15.  
  16. #You should have received a copy of the GNU General Public License
  17. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18. ######################################################################
  19.  
  20.  
  21. #fixes files with wrong modification date and time for NextCloud syncing
  22. #this should fix the modified "seconds ago" error
  23. IFS=$'\n'
  24. #get errors from Log files
  25. echo "Checking Log Files..."
  26. files="$(zcat /home/metalx1000/.config/Nextcloud/logs/*.gz|grep "Could not get modification time for"|cut -d\" -f2|sort -u)"
  27.  
  28. echo "$files"|while read f
  29. do
  30.   ls -lha $f
  31. done
  32.  
  33. read -p "Would you like to touch these files? (Y/n): " touch
  34.  
  35. if [[ "$touch" != "n" ]]
  36. then
  37.   echo "$files"|while read f
  38.   do
  39.     touch $f
  40.     ls -lha $f
  41.   done
  42. else
  43.   echo "$files"|while read f
  44.   do
  45.     echo $f
  46.   done
  47. fi
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement