I want to define a simple cron task that gets list of files and directories available in a specified folder and saves it to a file.

Here's the output of crontab -l

30 * * * * ls /mnt/q > /tmp/test.txt

The folder /mnt/q contains data from a network drive that's mounted using the following entry in /etc/fstab

Q: /mnt/q drvfs defaults 0 0

I have two instances running within WSL v1 (one Debian sid and one Ubuntu 22.04).

Setting up the cron task as I've described above works fine on Debian, but on Ubuntu the output file is just empty.

Also, executing the command ls /mnt/q > /tmp/test.txt manually on the Ubuntu instance works as expected.

I've compared the two instances in many different ways and can't see a reason for their different behaviour.

Does anyone have an idea?

  • 1
    Not an expert on this topic (at all!), but I guess I would expect to see status or error msgs appear in the logs or dmesg. Reboot and look right away?
    – shellter
    Feb 22 at 18:05


You must log in to answer this question.

Browse other questions tagged .