Score:2

Best way to watch the contents of a directory in near-real-time?

ps flag

I've got a server with an external HDD, I download files to the main disk then transfer them over to the HDD for storage. I mostly do file management over WinSCP, but it's not possible to move files between disks - is there an easy way to setup a service/daemon to watch a directory on my main disk, and if it detects that said directory isn't empty, move the contents to the HDD? I'd probably want to check it maybe every thirty seconds, just unsure if a cron job or another method is the best.

Raffa avatar
jp flag
Related: [Automatically copy incoming files to multiple folders then remove the source files](https://askubuntu.com/a/1443575/968501)
Artur Meinild avatar
vn flag
No need to reinvent the wheel - @Raffa has a nice solution, which is the closest to real-time you're going to get.
amekyras avatar
ps flag
Thanks, this is perfect!
eg flag
Does this answer your question? [Automatically copy incoming files to multiple folders then remove the source files](https://askubuntu.com/questions/1441969/automatically-copy-incoming-files-to-multiple-folders-then-remove-the-source-fil)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.