README.md (1818B)
1 # Diggah 2 3 Diggah is a command-line tool to find files and directories that were modified within a specific time range. It supports local file system searches as well as remote execution via ssh. 4 5 ## Installation 6 7 Ensure you have `fire`, and `paramiko` installed locally. 8 9 ## Usage 10 11 The main command is `search`. You can run the script directly: 12 13 ```bash 14 python3 diggah.py search [ARGS] 15 ``` 16 17 ### Examples 18 19 **1. Search valid relative to today (last 24h) in current directory:** 20 ```bash 21 python3 diggah.py search --today 22 ``` 23 24 **2. Search in a specific path:** 25 ```bash 26 python3 diggah.py search --today --path=/var/log 27 ``` 28 29 **3. Search for a specific week or month:** 30 ```bash 31 # Find modifications in the 1st week of January 2025 32 python3 diggah.py search --year=2025 --month=1 --week=1 33 34 # Find modifications in the whole month of January 2025 35 python3 diggah.py search --year=2025 --month=1 36 ``` 37 38 **4. Search with specific dates:** 39 ```bash 40 python3 diggah.py search --start_date=2025-01-01 --end_date=2025-01-07 41 ``` 42 43 **5. Include files in output (default is dirs only):** 44 ```bash 45 python3 diggah.py search --today --all 46 ``` 47 48 **6. Output Relative Paths:** 49 ```bash 50 # Output paths relative to the search directory (strip the prefix) 51 # e.g., /long/path/to/foo/bar -> foo/bar 52 python3 diggah.py search --today -r --path=/long/path/to 53 ``` 54 55 **7. Write to File (`-w`):** 56 ```bash 57 # Save output to a file with relative path (YYYY-MM-DD.txt) 58 python3 diggah.py search --relative --today -w 59 60 # Save to weekly files (1_01_2025.txt ... 4_01_2025.txt) 61 python3 diggah.py search --year=2025 --month=1 -w 62 ``` 63 64 **7. Remote Execution:** 65 ```bash 66 # Execute the search on a remote server 67 python3 diggah.py search --today --host=user@example.com --path=/opt/app/logs 68 ``` 69 70 ### Help 71 To see all available options: 72 ```bash 73 python3 diggah.py search --help 74 ```