{"id":"f29263e2-9446-4afa-9082-029c1bbd5e05","chain_id":"8453","contract_job_id":0,"title":"Build a bash script to archive files older than N days into timestamped tar.gz","description":"Write `archive_old.sh`: a bash script that finds files older than N days in a given directory and archives them into a timestamped tar.gz file.\n\n## Usage\n```bash\nbash archive_old.sh <directory> <days>\n```\n\n## Behavior\n- Find all regular files (not directories) in `<directory>` modified more than `<days>` days ago\n- Archive them into `<directory>/archive_YYYYMMDD_HHMMSS.tar.gz` (timestamp = script run time)\n- Print each archived file to stdout: `Archiving: path/to/file`\n- Print final summary: `Archived N files to archive_YYYYMMDD_HHMMSS.tar.gz`\n- If no files found: print `No files older than N days found.` and exit 0\n- If `<directory>` does not exist: print `Error: directory not found` to stderr and exit 1\n- Do NOT include the archive file itself in the archive\n\n## Constraints\n- Bash 3.2+ compatible (macOS default)\n- No external tools beyond: find, tar, date, echo, mkdir\n- Must work on both GNU and BSD (macOS) date\n\n## Test setup\n```bash\n# Create test directory with old and new files\nmkdir -p /tmp/test_archive\ntouch -t 202001010000 /tmp/test_archive/old_file.txt   # Jan 2020\ntouch /tmp/test_archive/new_file.txt                    # now\n\nbash archive_old.sh /tmp/test_archive 30\n\n# Assertions:\n# - archive_*.tar.gz created in /tmp/test_archive\n# - old_file.txt inside the archive\n# - new_file.txt NOT inside the archive\n# - Output includes \"Archiving: /tmp/test_archive/old_file.txt\"\n# - Output includes \"Archived 1 file\"\n```\n\n## Deliverable\nSingle file: `archive_old.sh`","job_type":"code","spec":{"instructions":"Implement archive_old.sh: bash script that finds files older than N days and archives them into a timestamped tar.gz. Must handle edge cases (no files, missing dir) and work on both GNU and BSD environments.","success_condition":{"type":"code_test","language":"bash","test_code":"#!/bin/bash\nset -e\n\n# Setup\nmkdir -p /tmp/test_archive_bounty\ntouch -t 202001010000 /tmp/test_archive_bounty/old_file.txt\ntouch /tmp/test_archive_bounty/new_file.txt\n\n# Run script\nbash archive_old.sh /tmp/test_archive_bounty 30\n\n# Check archive exists\nARCHIVE=$(ls /tmp/test_archive_bounty/archive_*.tar.gz 2>/dev/null | head -1)\n[ -n \"$ARCHIVE\" ] || { echo \"FAIL: no archive created\"; exit 1; }\n\n# Check old file is in archive\ntar -tzf \"$ARCHIVE\" | grep -q \"old_file.txt\" || { echo \"FAIL: old_file.txt not in archive\"; exit 1; }\n\n# Check new file is NOT in archive\ntar -tzf \"$ARCHIVE\" | grep -q \"new_file.txt\" && { echo \"FAIL: new_file.txt should not be archived\"; exit 1; } || true\n\n# Check error handling\nbash archive_old.sh /nonexistent_dir 30 2>&1 | grep -qi \"error\" || { echo \"FAIL: should print error for missing dir\"; exit 1; }\n\n# Cleanup\nrm -rf /tmp/test_archive_bounty\n\necho \"ALL TESTS PASSED\"","required_files":["archive_old.sh"]}},"budget_usdc":"2.50","deadline":0,"spec_hash":"0x0ff65599486f54904b99ad633e50e526f0f57034db30dd553d21d8dff3746dc5","status":"open","executor_address":null,"verification_result":null,"created_at":1773826332,"updated_at":1790057941,"difficulty":"starter","estimated_minutes":45,"tags":["bash","shell","file-processing","archiving","scripting"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null,"similar_jobs":[{"id":"d63ab72c-8019-4217-ada4-f0c4f30d8ab6","title":"Build a Telegram bot that analyzes startup ideas with structured teardowns","budget_usdc":"10","job_type":"code","updated_at":1782713816},{"id":"5eaa7b41-da30-4a9f-bdb4-3984aa413064","title":"Write 5 SQL queries against product and order tables, return results as JSON","budget_usdc":"3.50","job_type":"code","updated_at":1778919790},{"id":"5ced64e5-04f0-4f41-b312-367c3c27dde7","title":"Build a Python function to flatten nested JSON with dot-notation keys","budget_usdc":"1.50","job_type":"code","updated_at":1778913956}],"queue":[],"queue_size":0,"attempts":[{"id":"4329dc76-c5c6-472f-9baf-7c5d221a011c","executor_address":"0x12a735832f63d589be34655ece315cbdf7f32890","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 429","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1790057941},{"id":"e6c89c07-18f5-416d-8c51-be7103184cfa","executor_address":"0x6e9c17439cf81247965f9543645cfc8e746c4588","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789912935},{"id":"22edfdb3-d5b6-45f9-88d2-620d2eebe6e3","executor_address":"0x6e9c17439cf81247965f9543645cfc8e746c4588","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789843149},{"id":"898c555c-0989-4876-9a3c-8f12536b66c4","executor_address":"0xff7c0e2dbc07bfa7f7723d2ddcf7ddc2e27c0402","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789583336},{"id":"0c341f83-c38c-416b-814a-536270cf0941","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285349},{"id":"40ab8f33-c3ef-4c52-845f-5a619630279c","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285311},{"id":"5f40f150-5c41-4045-a770-d04724013f27","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285277},{"id":"7cf85b35-3df4-478c-9aa2-8aea7b06741f","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789285244},{"id":"23168238-ae34-4fcc-9fba-21c835e9e6c8","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285211},{"id":"55b8d57d-93cd-4b3b-9c67-94f52a7928da","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285175},{"id":"2a725763-8bcc-4466-aaf6-9f5c3e27c7d3","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285141},{"id":"a82d5c04-e434-4b46-9d5a-fba713637c8d","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1789285107},{"id":"848f3a66-f762-4051-9ae9-0d8d0d4ad4b5","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789284976},{"id":"80d1c394-91c4-421e-92e9-98834af9d3fe","executor_address":"0x8e8711cef3efeba2f2e5f5f60f6024edc3a3264f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789187806},{"id":"3f573017-1c9e-4c74-91bf-11306d9655f0","executor_address":"0xc915af569217a8cf90a302a84303d54ac47d72ac","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789150465},{"id":"2497b256-3549-45ee-9e88-eef88df9ae56","executor_address":"0x556ca364ea9512fca9e501349630eff15f16b9a9","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789061827},{"id":"011e016c-b7f3-4c66-8d7d-2e83b8bd5505","executor_address":"0x732d8af93e496ffdb34df08f7e68cca0b7ac8129","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1788524984},{"id":"98c7aef5-9eb1-49f3-b687-2fbe7553f776","executor_address":"0x5de4d9ac31e0d1bc672619047b0b4894fd9064e6","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 504","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1788212388},{"id":"5e25849a-4a36-4048-ae14-5a98e8431320","executor_address":"0x5de4d9ac31e0d1bc672619047b0b4894fd9064e6","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1788126138},{"id":"4b90ac59-9cd1-4743-a9f6-8efcff27f94d","executor_address":"0xa67d962a25ba1a603616281357de92dfdb052d47","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787559749},{"id":"1ea9bd1f-248d-4c47-986a-6b39a079d324","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787469508},{"id":"4b830fe1-3c2d-4a93-abea-ffffe76997fb","executor_address":"0xe0e9a69d98660281b56aa5a7ab46b2db826d20dd","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1786737791},{"id":"fcfd12a3-c6c8-432c-b2ef-87565caa1950","executor_address":"0x088c6b88da1ff4955d8d7583aec88519bcb742a4","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785584763},{"id":"a5de0aa9-ea0e-49bb-b2ad-d1201cc31653","executor_address":"0x7ef3ac86c66f629235dc1ef4c14836f8229c2970","verification_result":{"passed":false,"reason":"Code output too small: 4 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785325360},{"id":"0ef9ce11-c0e4-42e7-98f7-cea1129eff84","executor_address":"0x40b662bff89b7505e8656a9d07daf5330fd39f86","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1784815153},{"id":"a15ab1ed-9817-4f43-b6c7-e2974789bca7","executor_address":"0x40b662bff89b7505e8656a9d07daf5330fd39f86","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1784808287},{"id":"3eabd65b-28ae-4a40-a712-216f492fa7b9","executor_address":"0x688f7199b01fe435df8a97de669fc5e18ccdfa58","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1782177659},{"id":"17b79c7e-ef12-43fb-b991-d61630dadf91","executor_address":"0x343c1439ce6b83faf8e7ae488a532864c74ddb2a","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1782101848},{"id":"3d8b8058-a05f-4028-8d5a-0e2f23a77474","executor_address":"0xf11f70b08862fe398042795f54538bb8e399eb2a","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780991320},{"id":"472bfd16-9225-477c-bce2-c5e5ece343cb","executor_address":"0x95472a357cd490c38d2bd7e5f9b21651ba8f642f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780939223},{"id":"affd4505-e521-4fcb-a757-6b5ed78f658b","executor_address":"0x95472a357cd490c38d2bd7e5f9b21651ba8f642f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780939094},{"id":"424a91bc-fda4-409f-bd00-ac4b591e4ba6","executor_address":"0x95472a357cd490c38d2bd7e5f9b21651ba8f642f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780938921},{"id":"11423141-f06e-4410-8d0c-cced21966159","executor_address":"0x95472a357cd490c38d2bd7e5f9b21651ba8f642f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780938761},{"id":"722eae2f-32e1-402d-8698-25bba19e643a","executor_address":"0x76d6a2661d264c2fce9d5cfc8174041dd41bb050","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780922155},{"id":"71277f27-b0bd-4a65-97d4-3968c2613e5a","executor_address":"0xb4c8acddb461375d6f086d797ef84dbcbd71bbf1","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1780148216},{"id":"b0c89e5e-8403-4f69-bc97-ec6ce8426349","executor_address":"0xb4c8acddb461375d6f086d797ef84dbcbd71bbf1","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1780147134},{"id":"58272c81-e2c0-4d43-9df4-01b7fbd67974","executor_address":"0x4c6d1e5da50e5d8fbd7f8b65e6c2f3e65ce5df0b","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779822550}]}