AtOM/lib/files/removeObsoleteFiles
2026-03-13 17:38:41 +01:00

24 lines
894 B
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Copyright © 2012-2026 ScriptFanix
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# A copy of the GNU General Public License v3 is includded in the LICENSE file
# at the root of the project.
removeObsoleteFiles() {
# Delete source_files records that were not seen in the latest scan.
# The DB's ON DELETE CASCADE will remove tags
# ON DELETE SET NULL will let us take care of destination_files later.
Delete source_files <<-EOWhere
last_seen < $scantime
EOWhere
}